Classloader issue: java.lang.ObjectMissing no-arg constructo
kenwjennings Apr 16, 2002 4:41 PMI'm getting an error in JBoss 3.0 when my servlet tries to get a reference to the home interface of my session bean. I do this in the typical way:
Object ref = ic.lookup("java:comp/env/ejb/CourseAccessHome");
This worked fine in JBoss2.4.4. Porting it over to JBoss3.0 beta, however, I removed the EJB classes from the WEB-INF directory of my servlet's .war file in order to take advantage of the new UnifiedClassLoader in 3.0. However, the context lookup above now gives me the following:
2002-04-16 14:26:51,813 ERROR [Default] javax.naming.CommunicationException. Root exception is
2002-04-16 14:26:51,814 ERROR [Default] java.io.InvalidClassException: java.lang.ObjectMissing no-arg constructor for class
2002-04-16 14:26:51,814 ERROR [Default] at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1350)
2002-04-16 14:26:51,815 ERROR [Default] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
2002-04-16 14:26:51,816 ERROR [Default] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
2002-04-16 14:26:51,816 ERROR [Default] at java.rmi.MarshalledObject.get(MarshalledObject.java:138)
2002-04-16 14:26:51,817 ERROR [Default] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:369)
2002-04-16 14:26:51,817 ERROR [Default] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
2002-04-16 14:26:51,818 ERROR [Default] at javax.naming.InitialContext.lookup(InitialContext.java:350)
2002-04-16 14:26:51,819 ERROR [Default] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:437)
2002-04-16 14:26:51,819 ERROR [Default] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:473)
2002-04-16 14:26:51,820 ERROR [Default] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
2002-04-16 14:26:51,820 ERROR [Default] at javax.naming.InitialContext.lookup(InitialContext.java:350)
2002-04-16 14:26:51,821 ERROR [Default] at com.comphealth.training.CourseServlet.createCourseAccess(CourseServlet.java:97)
etc.
Looks like a marshalling problem with Serializable, I guess, except I don't know what the problem might be. Repeated attempts to hit the servlet result in a different error:
2002-04-16 14:28:13,977 ERROR [org.jboss.web.catalina.EmbeddedCatalinaServiceSX] ----- Root Cause -----
java.lang.NoClassDefFoundError
at java.io.ObjectInputStream.allocateNewObject(Native Method)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1347)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at java.rmi.MarshalledObject.get(MarshalledObject.java:138)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:369)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:437)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:473)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.comphealth.training.CourseServlet.createCourseAccess(CourseServlet.java:97)
etc.
This is similar to a problem reported in the forums here:
http://main.jboss.org/thread.jsp?forum=47&thread=6759
that as far as I can tell was never solved.
I can't think of anything weird in my configuration...this is JBoss 3.0 beta straight off the site. This is also EJB code that worked flawlessly before I ported it over from JBoss 2.4.4.
Suggestions?