• Post Reply Bookmark Topic Watch Topic
  • New Topic

J2EE client standalone jndi lookup java.lang NoClassDefFoundError  RSS feed

 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, again...
I've not problem performing a jndi lookup inside JBOSS 4.0.5, but I can't say the same thing out of it.

My client code is very simple:


returns me the following error

Testcase: testEcho(eu.virtualLab.util.dataTransfer.dao.DaoImplTest):Caused an ERROR
javax/persistence/EntityExistsException
java.lang.NoClassDefFoundError: javax/persistence/EntityExistsException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.privateGetPublicMethods(Class.java:2519)
at java.lang.Class.getMethods(Class.java:1406)
at sun.misc.ProxyGenerator.generateClassFile(ProxyGenerator.java:409)
at sun.misc.ProxyGenerator.generateProxyClass(ProxyGenerator.java:306)
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:501)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:676)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:647)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:517)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1500)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1463)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:351)


jndi properties are ok and all jars required have been added to the classpath.

What actually I don't understand is the javax/persistence/EntityExistsException .... (in the jndi lookup!)
 
Rejeev Divakaran
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like the object returned by JNDI lookup contains (references) an instance of EntityExistsException and EntityExistsException is not in the client side classpath.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!