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.class


23: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)
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3913715#3913715

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3913715


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to