Try adding this as the last RequestInterceptor in your server.xml and
restarting Tomcat
<!-- Add request interceptor to prevent classloader conflicts -->
<RequestInterceptor
className="org.apache.tomcat.request.Jdk12Interceptor"
debug="0" />
If you want to know *why* I suggest you pop across to the developer list and
read the archives (more gory detail about classloaders than I'm willing to
go into this early in the morning). I had a very similar problem looking up
EJBs from a servlet and the above fixed it.
Nic
> ----------
> From: Havanki, Bill (NCI)[SMTP:[EMAIL PROTECTED]]
> Sent: 20 December 2000 17:26
> To: 'Tomcat Users Mailing List'
> Subject: ClassCastException when receiving RMI stub
>
> I have a servlet which looks up a remote object over RMI.
> The line of code that does it looks like this:
>
> RemoteInterface remoteObject =
> (RemoteInterface) Naming.lookup
> ("rmi://localhost:1099/RemoteObjectName");
>
> Under Tomcat 3.2, this triggers a ClassCastException.
> According to the exception, the right stub class is being
> returned by the RMI registry.
>
> Under Tomcat 3.1, no exception is raised ... it works fine!
> Am I missing something? Has anyone else experienced this
> problem?
>
> Thanks in advance,
> Bill
>