Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NoClassDefFoundError when I try to get a EJB home interface from another ear

2 views
Skip to first unread message

crosignanii

unread,
May 13, 2004, 3:17:51 AM5/13/04
to
I have a workspace in WSAD 5.1 with two EAR projects.
My problem comes up when i try to recover
from a Session EJB (SessionFacadePerOrganigramma)
a home interface of a entity CMP ejb
that is located in another EAR in the same workspace :

try {
InitialContext ic = new InitialContext();
Object obj = ic.lookup("java:comp/env/ejb/MyEJB");

MyEJBHome home = (MyEJBHome)PortableRemoteObject.narrow(obj, MyEJB.class);

utHome = (MyEJB) obj;

} catch (NamingException e) {
System.out.println(" eee " + e.getMessage());
// TODO Auto-generated catch block
e.printStackTrace();
}


The project of the session bean
can get a reference to entity in the other project. As a matter of fact, it is all compiled without a mistake.
Anyway when I try to recover the home interface of the entity I get the following error:

Can you give me some help?
Thanks.
I.

com.ibm.ejs.container.UnknownLocalException: ; nested exception is: com.ibm.ws.exception.WsEJBException: nested exception is: java.lang.NoClassDefFoundError: mypackage.ejb.MyEJB
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapException(LocalExceptionMappingStrategy.java:198)
at com.ibm.ejs.container.LocalExceptionMappingStrategy.setUncheckedException(LocalExceptionMappingStrategy.java:266)
at com.ibm.ejs.container.EJSDeployedSupport.setUncheckedLocalException(EJSDeployedSupport.java:316)
at it.isidenet.zappe.ejb.EJSLocalStatelessSessionFacadePerOrganigramma_78feff87.getDatiUtente(EJSLocalStatelessSessionFacadePerOrganigramma_78feff87.java:29)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.etools.utc.model.ReflectionMethodModel.invoke(ReflectionMethodModel.java:68)
at com.ibm.etools.utc.servlet.InvokeServlet.invoke(InvokeServlet.java:110)
at com.ibm.etools.utc.servlet.InvokeServlet.doPost(InvokeServlet.java:352)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:435)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
---- Begin backtrace for nested exception
com.ibm.ws.exception.WsEJBException: nested exception is: java.lang.NoClassDefFoundError: mypackage.ejb.MyEJB
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapException(LocalExceptionMappingStrategy.java:159)
at com.ibm.ejs.container.LocalExceptionMappingStrategy.setUncheckedException(LocalExceptionMappingStrategy.java:266)
at com.ibm.ejs.container.EJSDeployedSupport.setUncheckedLocalException(EJSDeployedSupport.java:316)
at it.isidenet.zappe.ejb.EJSLocalStatelessSessionFacadePerOrganigramma_78feff87.getDatiUtente(EJSLocalStatelessSessionFacadePerOrganigramma_78feff87.java:29)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.etools.utc.model.ReflectionMethodModel.invoke(ReflectionMethodModel.java:68)
at com.ibm.etools.utc.servlet.InvokeServlet.invoke(InvokeServlet.java:110)
at com.ibm.etools.utc.servlet.InvokeServlet.doPost(InvokeServlet.java:352)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:435)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
---- Begin backtrace for nested exception
java.lang.NoClassDefFoundError: it.isidenet.organigramma.ejb.UtentiorganigrammaHome
at it.isidenet.zappe.ejb.SessionFacadePerOrganigrammaBean.getDatiUtente(SessionFacadePerOrganigrammaBean.java:55)
at it.isidenet.zappe.ejb.EJSLocalStatelessSessionFacadePerOrganigramma_78feff87.getDatiUtente(EJSLocalStatelessSessionFacadePerOrganigramma_78feff87.java:23)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.etools.utc.model.ReflectionMethodModel.invoke(ReflectionMethodModel.java:68)
at com.ibm.etools.utc.servlet.InvokeServlet.invoke(InvokeServlet.java:110)
at com.ibm.etools.utc.servlet.InvokeServlet.doPost(InvokeServlet.java:352)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:435)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)


Uri

unread,
May 14, 2004, 4:42:43 PM5/14/04
to
do you have an EJB client jar in the other ear?
If you don't use an EJB client jar you must change ClassLoader policy
setting in the Server settings editor to SINGLE. this will enable ONE
classLoader for all applications running on the server.
your code compiles because you probably have a Project reference to
the other project in your build path, but this actually means nothing
in run time....
for runtime you have two choices:
1) use EJB client jar in the referencing project and define a JAR
dependency to it.
2) server ClassLoader Policy -> "SINGLE".

crosignanii <crosi...@iside.bcc.it> wrote in message news:<76802983.1084432670628.JavaMail.wasadmin@swg3ws006>...

Solo Chiang

unread,
Mar 6, 2005, 10:47:43 AM3/6/05
to
Hi, Mr. Crosignanii

I got your post in the newsgroup and the reason I email you is simply
because I got the same problem. Did you find a way to fix it? If yes,
would you please tell me how to do it? Thanks a lot!

Solo

0 new messages