Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes Deploying EJB and dependent classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Deploying EJB and dependent classes" Watch "Deploying EJB and dependent classes" New topic
Author

Deploying EJB and dependent classes

vivek nagulapati
Greenhorn

Joined: Feb 02, 2004
Posts: 1
Hello All,
I am trying to deploy an EJB which uses an external Java class to perform the business logic. I packed the EJB, along with the deployment descriptors and the external Java class into a jar file and tried deploying the EJB bean.
I am always getting a "NoClassFoundError" on the external class when deploying the EJB. Somehow the application server i.e., JBoss 3.2.1 is unable to load the external Java class.
I tried packing the external jar file and copied the jar file into the "server/default/lib" but in vain. I also tried "CLASSPATH" point to the jar file but the error still persisted.
Do we have to edit the ejb-jar.xml file and can we use <resource-ref> for external Java classes or is it reserved for external EJB's?
Can anyone help me?
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
I suspect that it's not the external class that is the problem but rather some other class that that class depends on. NoClassDefFound exceptions are tricky to track down, but often it isn't the class that is in the exception message. Take a look at that class's imports (and the imports of those classes) to see what class in the tree is missing.
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Originally posted by vivek nagulapati:

I tried packing the external jar file and copied the jar file into the "server/default/lib" but in vain. I also tried "CLASSPATH" point to the jar file but the error still persisted.
Can anyone help me?

Business Classes should not be in the server classpath as they're problably not used for most of the applications.
You should package the classes together with your .jar or .ear file. It's also a good idea to read about the classloader of the app server u're using.
regards.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deploying EJB and dependent classes
 
Similar Threads
deploying the ejb
How to know which class is loaded from which jar file alongwith location?
JBoss with EJB
i'm so frustrated......deployment issue
Getting MissingResourceException calling getBundle()