Folks,
I have 1 basic question-
I got a WAR module which 1 JSP init.
I got a EJB module which has 1 stateless session bean init.
I deployed both of them separately to the appserver.
Inside the JSP,i have a JNDI lookup to the session bean in the ejb module and also i put the session bean client jar in the war module(WEB-INF/lib).
But,when i execute the JSP(thru browser),the JNDI lookup is failing saying that,not able to load the bean.
I know,if my put both WAR & JAR in the EAR,it will work.But i have a situation,where i got an app that is writen in WAR and i need to extend it...
any idea...
thanks,
u.
-
Accessing EJB's from WAR! (5 messages)
- Posted by: Uday Subbarayan
- Posted on: January 29 2003 20:35 EST
Threaded Messages (5)
- Accessing EJB's from WAR! by prajakt deshpande on January 30 2003 02:36 EST
- Accessing EJB's from WAR! by Brian Chan on January 31 2003 10:15 EST
- Accessing EJB's from WAR! by Dieter Cailliau on February 05 2003 12:54 EST
- java:comp/env/ namespace by prajakt deshpande on February 09 2003 23:08 EST
- Accessing EJB's from WAR by Jayashree Gopalakrishnan on February 06 2003 04:35 EST
-
Accessing EJB's from WAR![ Go to top ]
- Posted by: prajakt deshpande
- Posted on: January 30 2003 02:36 EST
- in response to Uday Subbarayan
try to inlcude the ejb reomte interfaces and the stub classes in the war module . I did the same thing and it works form me .(jsp accessing an ejb deployed another ear file).
I tried this on the websphere 5.0 server .
thanx and regards
Prajakt -
Accessing EJB's from WAR![ Go to top ]
- Posted by: Brian Chan
- Posted on: January 31 2003 10:15 EST
- in response to Uday Subbarayan
Depending on which AppServer you are using, I deployed it the same way as you did in WebLogic and it works fine as long as the WAR includes EJB client classes. In some cases, you might need an entry in web.xml in your WAR that reference the EJB. Consult Web.xml DTD. -
Accessing EJB's from WAR![ Go to top ]
- Posted by: Dieter Cailliau
- Posted on: February 05 2003 12:54 EST
- in response to Uday Subbarayan
if you deploy the ejb in a separate ear than the jsp, the lookup has to be "blabla", and if you deploy both the jsp and the ejb in the same ear, it has to be "java:comp/env/blabla".
At least this works for me, eventhough i don't realy understand it. -
java:comp/env/ namespace[ Go to top ]
- Posted by: prajakt deshpande
- Posted on: February 09 2003 23:08 EST
- in response to Dieter Cailliau
Hi ,
<Dieter Cailliau>
if you deploy the ejb in a separate ear than the jsp, the lookup has to be "blabla", and if you deploy both the jsp and the ejb in the same ear, it has to be "java:comp/env/blabla".
At least this works for me, eventhough i don't realy understand it.
</Dieter Cailliau>
There are 2 types of clients in a J2EE environment
1) J2EE client , one which resides in the same container context (ejb1 refreing to ejb2 within the same ear)
2) Thin client ,one which resides outside the container context (diff ear or a standalone java client).
In the case one the client can refr to the ejbs using the logical namespace java:com:/env/ejb2 while in the second case the name should be the fully qualified jndi name.
I am still looking for the clues whether this is manadted by EJB spec (thought it doesn't seem so ) or is it a industry standard practice .
hope it helps .... -
Accessing EJB's from WAR[ Go to top ]
- Posted by: Jayashree Gopalakrishnan
- Posted on: February 06 2003 04:35 EST
- in response to Uday Subbarayan
Hello,
We have been using ejb's and war files separately. However, our ejb's were deployed on to weblogic server 6.
we had an application.xml file which contained info about the context root and the uri of the war file and the ejb's tht it was dependent on.
Maybe, u could try writing the application.xml file. Yet another way would be the path of the jar file in startweblogic.cmd file. Hope this helps!