cancel
Showing results for 
Search instead for 
Did you mean: 

EJB Client in different workspace than EJB Project

Former Member
0 Kudos

Hi everyone,

I'm trying to access a (remote) EJB3 from a Client-Application. Everything works fine when I have the client project in the same workspace as the EJB-Project (I'm adding the EJB-Project to the buildpath of the Client-Project).

However when I have the client project in a different workspace (reference to the EJB-Project via an exported jar version of the EJB-Project in the buildpath of this client) I get:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/ejb/NoSuchEJBException

at com.sap.engine.services.ejb3.runtime.SerializedClientProxy.readResolve(SerializedClientProxy.java:86)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1033)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1728)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)

at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)

at com.sap.engine.services.rmi_p4.reflect.P4InvocationHandler.readResult(P4InvocationHandler.java:303)

at com.sap.engine.services.rmi_p4.reflect.P4InvocationHandler.invokeInternal(P4InvocationHandler.java:138)

at com.sap.engine.services.rmi_p4.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:52)

at $Proxy0.resolveReference(Unknown Source)

at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:129)

at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58)

at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)

at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:521)

at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

{/code}

as soon as I do the .lookup of the Bean on the InitialContext.

What am I doing wrong?

As I finally want to access the EJB via an Eclipse Plugin it is mandatory to have the EJB-Project as a jar-archive (correct me if I'm wrong).

Any help is greatly appreciated, best

Joerg

Edited by: Joerg Woehrle on Jan 7, 2009 4:35 PM

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Joerg,

Do you have a reference to the EJB API (javax.ejb.*) jar in the classpath of the client?

Cheers,

\-- Vladimir

Former Member
0 Kudos

oh man, adding the "ejb-3_0-api.jar" did the trick.

I spent hours and days trying to resolve this.

Thank you so much !

Answers (0)