tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirk Rasmussen <>
Subject RE: servlets in tomcat - EJBs in WebLogic 5.1
Date Wed, 27 Sep 2000 17:53:21 GMT
AFAIK you will always get a class cast exception if two classes use
different class loaders during the cast process.  You can avoid this by
making sure each class was loaded by the same ClassLoader.  Every class is
associated with only one ClassLoader.  Another trick is to create a simple
interface that wraps the one you want to use that always uses the system
class loader.

Any other suggestions?

-----Original Message-----
From: matthew denner []
Sent: Wednesday, September 27, 2000 4:45 AM
Subject: servlets in tomcat - EJBs in WebLogic 5.1

Dear all,

i wanted to drop everyone a mail to point out a problem that i've had with
tomcat and weblogic 5.1 interacting just to see if anyone has experienced a
similar problem and whether there is a better solution.

i have some session EJBs deployed in weblogic 5.1; a servlet running under
tomcat creates one these EJBs and then uses it (i know the architecture
great but i'm attempting to migrate slowly).  the problem is that i get a
ClassCastException thrown when i try to narrow the EJB Home interface 
retrieved from the initial context.

the problem can be solved by NOT putting the EJB jar file in the WEB-INF/lib
directory for the servlet, but rather to add it to the CLASSPATH used by
tomcat on startup.  i'm assuming this has something to do with difference
between the class loading mechanisms for tomcat and the servlets.  i do not 
want this nasty solution to be the only one; anyone recommend a better one?

to the developers of tomcat, is this a bug, feature, or something that has
been overlooked?  can it be fixed?


Sessami is a trademark of Escape Velocity Technology Mobile Services
All information contained in this e-mail is confidential and for the use of
the addressee only.  If you receive this message in error please notify.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message