tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Smith" <>
Subject ClassCastException when pulling an object from ServletContext.
Date Mon, 06 Jan 2003 20:16:46 GMT
    We have a development tomcat 3.3.1 final on a server that has Red Hat Linux release 7.1
(Seawolf) Kernel 2.4.2-2 on an i686. 
There are no problems here whatsoever when retrieving an object from the ServletContext and
casting it to it's original type.

    On my machine running windows2000 and another server running the same both with tomcat
3.3.1. A ClassCastException occurs when trying to get any object from
the ServerContext and cast it to it's actual type. One of the objects is a Connection Pool
instance that allows us to get a connection object from the pool that it maintains.
This throws a ClassCastException when getting a connection to logon. Our client is currently
using tomcat 3.3.1 so this restricts us at the moment.

Things of interest to note:
1. This problem does not seem to happen on tomcat 4.4.10.
2. This does not happen on the Red Hat Linux machine.
3. The problem is resolved when all of the applications class files are run from a jar file
in lib/apps instead of using class files in WEB-APPS/classes.

If anybody can help with this problem it will be much appreciated. 
I would like to know what the problem is caused by and how to fix it before considering upgrading
to tomcat 4.1.12 as the fix.
It will be good to know how to avoid this problem if in case it may arise in the future.

View raw message