Bugs item #547160, was opened at 2002-04-22 18:49 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=547160&group_id=22866
Category: CatalinaBundle Group: v2.4 (stable) Status: Closed Resolution: Fixed Priority: 5 Submitted By: Matthias Damsch (damschm) Assigned to: Scott M Stark (starksm) Summary: ClassCastException Initial Comment: I am using the JBoss 2.4.4 / Tomcat 4.0.1 bundle from the jboss homepage. Our application is using a servlet (MyServlet in the sample code) which instantiates some stateful sessionbeans (X in the sample code) which implements a interface (Base in the sample code). If we try to cast the bean to this interface we receive a 'ClassCastException'. Normally we add the class-file of the interface 'Base' to both, the ejb-jar and the war file. If we do so, the exception will be thrown. If we put the class file to the ejb-jar file only, this application works fine. Because this preventing us to run the servlet in an other VM than the session bean this is not really a workaround. I attach a zip file which contains sources and a ant build.xml file, which should help you to reproduce the problem. The doPost method of the MyServlet class contained in the attached zip file, implements two approaches which will fail. Depending on the approach that is used either java.lang.ClassCastException or java.lang.IncompatibleClassChangeError will be thrown. I tried the same application using the JBoss 2.4.3 / Tomcat 3.2.3 bundle and this works fine. The JBoss Server is running on a Windows NT4 Box with Sun JDK 1.3.1 installed. ---------------------------------------------------------------------- >Comment By: Matthias Damsch (damschm) Date: 2002-04-29 12:29 Message: Logged In: YES user_id=522793 scott, could you explain your note more in detail. As far as I know the servlet 2.3 specification changed the class loading model only to prevent servlets to load server classes. But how is that related to this problem and what could we do to get our code running ? ---------------------------------------------------------------------- Comment By: Scott M Stark (starksm) Date: 2002-04-28 00:08 Message: Logged In: YES user_id=175228 This is due to the servlet 2.3 class loading model loading from the war before its parent class loader. This behavior has been disabled by default. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=547160&group_id=22866 _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
