File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes BEA/Weblogic and the fly likes Accessing EJB from servlet in WAR file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Accessing EJB from servlet in WAR file" Watch "Accessing EJB from servlet in WAR file" New topic

Accessing EJB from servlet in WAR file

Vinu krish

Joined: Nov 20, 2003
Posts: 16
I have a EJB file and I have a WAR file. I have deployed them as seperate applications. WHen both are in a EAR file it works fine. But if I deploy them separately then the WAR file does not recognize the EJB home and remote interface. I have specified <ejb-reference-description> in weblogic.xml and also <ejb-ref> in web.xml as suggested by docs. Here are the pieces of code
and web.xml
Can anyone tell me where I am going wrong. What else should I add in my WAR file to access the EJB files. I am gettin the following exception
<Error> <HTTP> <101017> <[ServletContext(id=6100815,name=FreshEARWeb,context-path=/FreshEARWeb)] Root cause of ServletException
java.lang.NoClassDefFoundError: myejbs.ejbs.MyFirstStatelessBeanHome
Thanks in advance,
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
the home and component interfaces of your ejb are part of the client view of an ejb, knowing this you have to(mandatory) package them with your war archive.
I agree. Here's the link:
subject: Accessing EJB from servlet in WAR file
jQuery in Action, 3rd edition