-
1. Re: ClassCastException on EJB Remote Lookup/Narrow
darranl Jul 14, 2005 8:21 PM (in response to khoff999)Which version of JBoss are you using?
How is your application actually packaged?
If you have packaged the interfaces in the war file you need to remove them as that is probably the cause of the conflict. -
2. Re: ClassCastException on EJB Remote Lookup/Narrow
khoff999 Jul 15, 2005 7:30 AM (in response to khoff999)Thanks for responding. I'm using JBoss 4.0.2.
Yes, the interfaces are in the war file, in a jar under WEB-INF/lib. This was the suggested way to do it in the JBossIDE tutorial. How would you suggest I package them? -
3. Re: ClassCastException on EJB Remote Lookup/Narrow
jaikiran Jul 15, 2005 7:37 AM (in response to khoff999)Place the beans in a jar file, say MyBeans_ejb.jar, and mention this in the application.xml file as follows:
MyBeans_ejb.jar
I think this should work -
4. Re: ClassCastException on EJB Remote Lookup/Narrow
darranl Jul 15, 2005 7:43 AM (in response to khoff999)Have you packaged the jar and war together in an ear?
Just don't add the interfaces jar to the web application. If the beans are deployed within the ear of the war the interfaces will be available at runtime anyway. The section in the tutorial that shows how to do this probably needs to be removed now.
The problem is when they are packaged twice is that they get loaded by two different classloaders which makes them look as if they are different. -
5. Re: ClassCastException on EJB Remote Lookup/Narrow
jaikiran Jul 15, 2005 7:51 AM (in response to khoff999)Sorry, forgot to mention the contents of application.xml in the previous post:
Make an entry as follows:<module> <ejb>MyBeans_ejb.jar</ejb> </module> <module>
And create a jar file MyBeans.jar containing the interfaces and beans -
6. Re: ClassCastException on EJB Remote Lookup/Narrow
khoff999 Jul 15, 2005 8:48 AM (in response to khoff999)Yes, everything was in an ear. I did as you suggested and it works fine. Thanks.