-
1. Re: ClassCastException/Entity Bean Remoting
bill.burke Nov 26, 2005 4:50 PM (in response to liemans)Can you write a very simple testcase and attach it to a JIRA bug report please under the EJB3 project? And explicit directions on how to reproduce the problem?
WARs have a scoped classloader by default (required by spec). You can turn this off to use the unified, flat classloader scheme and this should fix the problem on JBoss.
But, if you are invoking on a remote interface, this shouldn't be a problem. -
2. Re: ClassCastException/Entity Bean Remoting
nholbrook Dec 14, 2005 12:37 PM (in response to liemans)"bill.burke@jboss.com" wrote:
WARs have a scoped classloader by default (required by spec). You can turn this off to use the unified, flat classloader scheme and this should fix the problem on JBoss.
How do I turn this off? I have the exact same problem. -
3. Re: ClassCastException/Entity Bean Remoting
nholbrook Dec 14, 2005 6:36 PM (in response to liemans)For more information, if I have a par, ejb3, and war in the same ear, I can't even include the par in the WEB-INF/lib of the war or I get ClassCastExceptoins. I need to be able to give the par to other web app developers as a jar for access to our entity objects. Is anybody looking into this? Just wondering since I haven't heard or seen anything yet.
-
4. Re: ClassCastException/Entity Bean Remoting
yantriki Dec 20, 2005 11:35 PM (in response to liemans)I am getting the same ClassCastException when using entity Bean in JBoss 4.0.3SP1. This only happens when I do a find on primary key using EntityManager's find method. It seems like the object is retrieved appropriately in the ejb-tier, however when returning to the Web-tier there is somewhere, it's throwing ClassCastException. When I am using a collection class to retrieve all the Books, I seem to be getting the appropriate values.
I have following structure in my code:
ejb3Test.ear
META-INF/MANIFEST.MF
META-INF/application.xml
ejb3Test.ejb3
ejb3Test.war
ejb3Test.par
ejb3Test.ejb3
META-INF/MANIFEST.MF
org/vss/ejb3/sb/BookManager.class
org/vss/ejb3/sb/BookManagerBean.class
ejb3Test.par
META-INF/MANIFEST.MF
META-INF/persistence.xml
org/vss/ejb3/eb/Book.class
ejb3Test.war has the following jar file for Book class
WEB-INF/lib/ejb3Test-client.jar
ejb3Test-client.jar
META-INF/MANIFEST.MF
org/vss/ejb3/eb/Book.class
org/vss/ejb3/sb/BookManager.class23:19:23,125 INFO [STDOUT] java.lang.ClassCastException: org.vss.ejb3.eb.Book 23:19:23,125 INFO [STDOUT] at $Proxy107.getBook(Unknown Source) 23:19:23,125 INFO [STDOUT] at org.vss.web.struts.library.SimulateDB.loadBookById(SimulateDB.java:34) 23:19:23,125 INFO [STDOUT] at org.vss.web.struts.library.action.BookEditAction.editBook(BookEditAction.java:45) 23:19:23,125 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 23:19:23,125 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 23:19:23,125 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 23:19:23,125 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
-
5. Re: ClassCastException/Entity Bean Remoting
yantriki Jan 18, 2006 11:17 AM (in response to liemans)I fixed it by removing ejb3Test-client.jar from the war file.