• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in deploying .ear file in weblogic6.1

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I m having a JSP file which calls a method of a session bean. How do I create the .ear file. Please give the detail procedure from the scratch. I tried this according to the doc. But still I m not able to deploy it. Any help is most welcome. Waiting for reply.
regards
Rajesh
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
First you have to create a war file for your jsp and web files, then create a jar file for your ejb, and then you�re gonna be able to build the ear file with war and jar inside.
 
Ashish Agarwal
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx for ur reply.
I tried that way, but still the same problem.
Let me explain u in detail what I have done.
creating jar:
I have 3 class files as following:
Square.class - Bean class which implements SessionBean. It has a method square() which returns the square of the passed integer.
SquareHome.class - Home interface
SquareRemote.class - Remote interface.
I created a temporary folder named "a". Inside this I created a folder "META-INF". I put these 3 classes inside "a". Then on command prompt I went to the folder "a" ("d:\a>"). I ran the tool
"java weblogic.ant.taskdefs.ejb20.DDInit ." to generate ejb-jar.xml and weblogic-ejb-jar.xml. Then I created the jar file by running
"jar -cvf sqjar.jar .".
creating war:
I created a temporary folder named "aa". Inside this I created a folder "WEB-INF". Inside WEB-INF I created a folder "classes". I put SquareHome.class and SquareRemote.class inside classes folder. I put the jsp file "sqr.jsp" inside "aa". Then on command prompt I went to the folder "a" ("d:\aa>"). I ran the tool
"java weblogic.ant.taskdefs.war.DDInit ." to generate web.xml and weblogic.xml. Then I created the war file by running
"jar -cvf sqwar.war .".
creating ear:
I created a temporary folder named "aaa". Inside this I created a folder "META-INF". I put the "sqjar.jar" and "sqwar.war" inside "aaa". Then on command prompt I went to the folder "a" ("d:\aaa>"). I ran the tool
"java weblogic.ant.taskdefs.ear.DDInit ." to generate application.xml. Then I created the ear file by running
"jar -cvf sqear.ear .".
sqr.jsp content:

<%@ page language="java" import="java.sql.*,java.util.*,javax.naming.*;" session="true" isThreadSafe="true" contentType="text/html" %>
<HTML>
<HEAD>
<title>Squaring a number</title>
</HEAD>
<BODY bgcolor=#ddeeff>
<%
try{
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://localhost:7001");
Context initial = new InitialContext(h);
Object objref = initial.lookup("SQ2");
SquareHome home =(SquareHome)PortableRemoteObject.narrow(objref,SquareHome.class);
SquareRemote s = home.create();
System.out.println("After squaring : "+s.square(Integer.parseInt(4));


}catch(Exception e){out.println("Exception ::"+e.toString());}
%>
</BODY>
</HTML>
In the lookup method I have passed the JNDI-NAME that is provided in the tag <jndi-name> in weblogic-ejb-jar.xml.
In application.xml the <context-root> tag contains the value "sqwar".
When I run the jsp by the url "http://localhost:7001/sqwar/sqr.jsp" it gives "cannot resolve symbol" for SquareHome and SquareRemote.
Please tell me what is wrong in the above deployment process. I tried the other way by not putting SquareHome.class and SquareRemote.class inside classes folder while creating the war file. Still the same problem.
Waiting for reply.
regards
Rajesh
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Looks like everithing is ok with your deployment process, and you really don�t need to package the ejb interfaces in the war file(if you build an ear file) because the way weblogic classloader works.
If you still have problems with it feel free to drop me an email at: mmaia@awa.com.br and atach the files, I�ll take a look for you.
 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know, whether I am right or wrong, but what about ejb-jar.xml and weblogic-ejb-jar.xml Descriptor files?? Are they not reqiured??
Be,
Tualha Khan
reply
    Bookmark Topic Watch Topic
  • New Topic