jQuery in Action, 3rd edition
The moose likes EJB and other Java EE Technologies and the fly likes EJB interfaces not found by client classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB interfaces not found by client classes" Watch "EJB interfaces not found by client classes" New topic

EJB interfaces not found by client classes

Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
I'm having a problem with WebLogic 6.1 and EJB interfaces not being found.
I need to be able to hot/redeploy EJBs without restarting WebLogic and, of course, use the EJBs from client classes within a web application.
The problem is that if I place the home and remote interfaces only to the EJB .jar file, the client classes are throwing ClassNotFoundExceptions. Then again, if I copy the interfaces to the web applications lib directory (included automatically in classpath upon startup), WebLogic says "MyEJB cannot be redeployed while the server is running (which I assume is due to the possibility that the interfaces in mywebapp/lib and myejb.jar become out of sync)...
So, any ideas? Every one of them are highly appreciated!

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
My preference is to package the EJB and WebApp in a J2EE Application (ear). Then the webapp will have access to the ejb and you won't have to mess around with client jars in WEB-INF/lib etc.
In WLS, you don't have to deploy the ear as a jar, you can deploy it as an "exploded" directory - like you probably do with your webapp. It'd look something like this:

The application.xml will have a <module> entry for the ejb jar and the webapp.
The warning message you are seeing is sometimes harmless - it means that WLS found some ejb classes outside the ejb-jar when the ejb was deployed. So it warns you that you might not be able to redeploy the ejb. As long as your ejb classes are not in the CLASSPATH when you started the server, you should be fine. But I still prefer using the application packaging.
I agree. Here's the link: http://aspose.com/file-tools
subject: EJB interfaces not found by client classes
It's not a secret anymore!