wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes java.lang.NoClassDefFoundError when the EJB Client is executed 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 "java.lang.NoClassDefFoundError when the EJB Client is executed" Watch "java.lang.NoClassDefFoundError when the EJB Client is executed" New topic
Author

java.lang.NoClassDefFoundError when the EJB Client is executed

Pankaj Poshirkar
Ranch Hand

Joined: Dec 31, 2009
Posts: 53
Dear All,

I am not so well versed in J2EE. I have developed one EJB project named 'ejbs'. And I have an EJB Client (running on a different JVM) which calls a remote method of a session bean of the EJB project.

I have added one folder named 'lib' in the EJB project 'ejbs' and added a jar file named external.jar file containing a java class file External.class. The session bean in the ejb project uses External class. So I have updated the location of this jar file in the Java Build Path of the ejb project 'ejbs'. Hence when I build the project, there is no compilation error. But there is a runtime error java.lang.NoClassDefFoundError: clients.ExternalClass when the client sends a request to the session bean.

Does it mean that setting the Java Build Path of the ejb project which uses External.class (contained in external.jar) is not enough for the server at run-time? Do I have to update the path of external.jar somewhere else too? If so please let me know where.

Thanks in adv,
Pankaj
Nirmal Mukundan
Ranch Hand

Joined: Feb 21, 2007
Posts: 37

once deployed, you would be calling the session bean using a java client. please ensure that you have set the class path properly.
Pankaj Poshirkar
Ranch Hand

Joined: Dec 31, 2009
Posts: 53
Nirmal Mukundan wrote:once deployed, you would be calling the session bean using a java client. please ensure that you have set the class path properly.


Hi Nirmal,

I have set the classpath properly on the server side using Java Build Path for the ejb project 'ejbs'. I have added the name of the jar file in the Manifest file of the EAR project but still no progress.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError when the EJB Client is executed
 
Similar Threads
Test 488 questions
Bundle lib in ejb jar doesn't deploy
Error while using lookup
How to refer web project from ejb project
Cannot call EJB from Servlet