• Post Reply Bookmark Topic Watch Topic
  • New Topic

Import java class into EJB NoClassDefFoundError  RSS feed

 
stiptkevin Lala
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

I'm having some trouble with my EJB. I have it together with a other java project (JavaShared), a gwt project and a JPA project in my EAR.
In this JavaShared project there is one class which i want to use as a object.

In my EJB bean I want to create a new instance of this object, fill it and send it back to the gwt project.
The code seems all fine, no errors. But when I run it on the server I get a NoClassDefFoundError on the imported java class from the other project.
Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is com.ibm.ejs.container.ContainerEJBException: Unable to initialize deferred EJB.; nested exception is: java.lang.NoClassDefFoundError: nl.dvr.shared.User]

nl.dvr.shared.User is the class from the JavaShared project. Here is part is my code:



I've tried adding the JavaShared project to the Build-Path of the EJB en the EJBclient. Also tried adding it to the Java EE Module Dependecies for both. But still getting the error.
Double checked to see if they are both in the EAR, they are.
I dont know it anymore, been struggling with this all day now, getting crazy

Help me, what am I doing wrong?

Thanks!
Kevin

EDIT: I'm using RAD 7.5 and a local WAS7 server

 
stiptkevin Lala
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oke I got above problem fixed now.
But now I get a normal NoClassDefFoundError during the code for my entity from my JPA project.
EJB threw an unexpected (non-declared) exception during invocation of method "checkLogin" on bean "BeanId(hgEAR#EJB1.jar#UserBean, null)". Exception data: java.lang.NoClassDefFoundError: nl/dvr/entities/Users
at nl.dvr.session.UserBean.checkLogin(UserBean.java:47)





Tried to put all the setting for the JPA the same as my JavaShared project but this aint fixing it.
I've build JPA-EJB apps before without a problem like this. The JPA is also in the EAR.
Is there something i forgot?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!