I have an app currently running on Tomcat 5.5.26/CentOS
4.6/jre1.5.0_16. This configuration is working just fine. But if I run
Tomcat with jre1.6.0_07, my application gets a ClassNotFoundException
when I try to use it. The application starts up OK, but throws the
exception upon first use. If I restart Tomcat under Java 5, all is
well again. I am changing nothing but the symlink /usr/java/default
when I switch Java versions.

The class in question is packaged in WEB-INF/lib/mylib.jar.

No doubt of great importance is that the instance of the class is used
as a field in an object being returned from a call to a JBoss 4.2.2
EJB session bean on a remote server. JBoss is running under
jre1.5.0_14. So is this simply a serialization compatibility problem?
Then why am I getting ClassNotFound instead of an unmarshalling error?
The class files on both Tomcat and JBoss are the same (compiled once,
packaged twice).

Leaving no stone unturned, I installed Java 6 on the development JBoss
system and configured JBoss to use it, but Tomcat (under Java 6) still
gives me ClassNotFoundException. The JBoss server reports no errors.

The classes are actually compiled with 1.4 so there should not be any
code compatibility problems.

So why is Tomcat not finding my classes in WEB-INF/lib when running
under Java 6?

I really want to get everything running under Java 6 so I can start
compiling with that version.

Here's the stack trace:

 2008-08-28 14:54:46,849 ERROR TP-Processor2
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/online].[LoginServlet]
- Servlet.service() for servlet LoginServlet threw exce
ption
 java.lang.reflect.UndeclaredThrowableException
        at $Proxy1.loginWebUser(Unknown Source)
        at com.anon.offsite.servlet.LoginServlet.login(Unknown Source)
        at com.anon.offsite.servlet.LoginServlet.processLogin(Unknown Source)
        at com.anon.offsite.servlet.LoginServlet.doPost(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at com.anon.offsite.servlet.NoCacheFilter.doFilter(Unknown Source)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at 
org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
        at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
        at 
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.anon.util.Ticket
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at java.io.ObjectInputStream.resolveClass(Unknown Source)
        at 
org.jboss.invocation.MarshalledValueInputStream.resolveClass(MarshalledValueInputStream.java:109)
        at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
        at java.io.ObjectInputStream.readClassDesc(Unknown Source)
        at java.io.ObjectInputStream.readArray(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:91)
        at 
org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:195)
        at 
org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
        at 
org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
        at 
org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
        at 
org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
        at 
org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
        at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
        ... 25 more

-- 
Jeff

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to