-
1. Re: ClassCastException After HotDeploy Stateful Session Bean
gudmundsonsc Jun 14, 2004 7:26 PM (in response to gudmundsonsc)BTW, this is with JBoss 3.2.4.
-
2. Re: ClassCastException After HotDeploy Stateful Session Bean
jae77 Jun 15, 2004 9:18 AM (in response to gudmundsonsc)http://www.jboss.org/wiki/Wiki.jsp?page=HotDeployClassCastExceptions
(this would (should) have come up in a search of the forums). -
3. Re: ClassCastException After HotDeploy Stateful Session Bean
gudmundsonsc Jun 15, 2004 12:15 PM (in response to gudmundsonsc)Yep, I had already read that page and decided it did not apply in this situation. Let me explain my understanding of the problem.
The class that the code snippet is copied from is called TeacherApplicationBD (business deligate) and it is packaged in the exact same jar that the ejb is packaged in and it is not keeping any reference to the class returned from before the hot deploy, it is simply getting the new TeacherApplicationSessionHome class through lookup and then trying to cast it as such in order to use it.
For an unexplained reason, the TeacherApplicationSessionHome class used to perform the cast is from an old class loader that should have been completly replaced by the new ear deployment (notice how url=null after hot deployment). -
4. Re: ClassCastException After HotDeploy Stateful Session Bean
jae77 Jun 15, 2004 12:28 PM (in response to gudmundsonsc)is the web app packaged inside the ear?
-
5. Re: ClassCastException After HotDeploy Stateful Session Bean
gudmundsonsc Jun 15, 2004 3:45 PM (in response to gudmundsonsc)Yes it is as well.
-
6. Re: ClassCastException After HotDeploy Stateful Session Bean
gudmundsonsc Jun 15, 2004 5:19 PM (in response to gudmundsonsc)After much experimentation, I have found that if I move the code that calls and loads the TeacherApplicationBD class directly into a jsp, it works there. For some reason when the TeacherApplicationBD class is loaded from an Action Class it causes the ClassCastException inside the TeacherApplicationBD constructor (the code listed above). The one thing I can think of is that the Action Class extends org.apache.struts.action.Action which is loaded from a struts.jar located outside of the ear and that must somehow cause the problem?
-
7. Re: ClassCastException After HotDeploy Stateful Session Bean
gudmundsonsc Jun 21, 2004 5:52 PM (in response to gudmundsonsc)OK, here is a summary of how I resolved this issue:
jbossweb-tomcat50.sar\META-INF\jboss-service.xml:
1. set attribute Java2ClassLoadingCompliance to false
2. set attribute UseJBossWebLoader to false
in building my war (which is included in the ear), I make sure that all required library jar files (such as struts) are in the WEB-INF/lib/ directory.