I'm using JBoss 4.0.4 GA an I wrote a stateful session bean which has to 
entitymanager injected (like the following)
@PersistenceContext(unitName="myunit",type=PersistenceContextType.EXTENDED) 
protected  EntityManager em;

When the bean is activeted after passivation, I get an ClassCastEx. The 
following code throws the exception:


  | MyEntity m = null;
  | Object test = this.em.find(MyEntity.class, aCorrectPkWichIsALong);
  | //test is found - debugger says: Yep, it is a ....MyEntity
  | m = (MyEntity)o; //ClassCastException
  | 

I tried to make the em transient and set him to null - both did not work.

I also set up a jboss-app.xml in my EAR to separate classloaders:

  | <jboss-app>
  |     <loader-repository>
  |    dot.com:loader=testproject-Hanse1.ear 
  |     </loader-repository>
  | </jboss-app>
  | 
but that has no effect, too.

What could I do?

Best regards,
Carsten

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

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


_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to