Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 6205 invoked from network); 28 Sep 2000 01:29:18 -0000 Received: from prophecy-4.dsl.speakeasy.net (HELO speedpalace.com) (root@216.254.6.160) by locus.apache.org with SMTP; 28 Sep 2000 01:29:18 -0000 Received: from progeeks.com (hal.speedpalace.com [216.254.6.157]) by speedpalace.com (8.8.5/8.8.5) with ESMTP id JAA12758 for ; Wed, 27 Sep 2000 09:13:01 -0400 Message-ID: <39D29FAF.192D42C5@progeeks.com> Date: Wed, 27 Sep 2000 21:32:31 -0400 From: Paul Speed Reply-To: pspeed@progeeks.com X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-dev@jakarta.apache.org Subject: Re: servlets in tomcat - EJBs in WebLogic 5.1 References: <39D1DDA6.13DE2D1B@evtechnology.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hello, I'm not going to be of much help... I know why it happens but I don't know how to fix it yet. We have the exact same problem and I would be glad to hear if you find a solution. Since it works with things being in CLASSPATH it got pushed to the back burner. One thing you might try is removing the EJB classes, like the home interface, from the jar file that you put in WEB-INF/lib. This _should_ cause the classes to be loaded over the connection to Weblogic and should eliminate your class casting problems... but I have not tried it and it is a much less than ideal solution. What happens is that the classloader that's used when marshalling objects from Weblogic to Tomcat is a sibling to the classloader that your servlets/jsps use. So class Foo loaded in one is not cast-compatable with class Foo loaded in the other. Since classloaders generally defer loading to their parent classloader, then when you put class Foo in your system classpath then the class is only loaded once. The solution is to somehow get Weblogic's classloader to use the servlet/jsp classloader as its parent. The other day someone suggested setting the Thread's classloader context. I'm not sure if this will work with Weblogic... but it sounds like the right idea. Good luck and let me know if you get it working! -Paul matthew denner wrote: > > 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 isn't > 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? > > Cheers, > Matt > > ----------------------------------------------------------------------------- > Sessami is a trademark of Escape Velocity Technology Mobile Services Limited. > 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: tomcat-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org