Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception came when change stateful to stateless in ejb-jar.xml [Ejb 2.0]

 
S Test
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am getting exception when i change the below entry from Stateful to Stateless for Transaction Type "Container"..

----------------------------------------------------------------Working Fine for single and multi users----------------------------------------------------
<session>
<description>Entity Bean Employee Example</description>
<ejb-name>Stlg</ejb-name>
<local-home>com..ejb.session.ejbeans.StlgHome</local-home>
<local>com.ejb.session.ejbeans.Stlg</local>
<ejb-class>com.ejb.session.ejbeans.StlgBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</session>
----------------------------------------------------------------Working Fine for single and multi users----------------------------------------------------





----------------------------------------------------------------Working Fine for single user and exception for multi users----------------------------------------------------
<session>
<description>Entity Bean Employee Example</description>
<ejb-name>Stlg</ejb-name>
<local-home>com..ejb.session.ejbeans.StlgHome</local-home>
<local>com.ejb.session.ejbeans.Stlg</local>
<ejb-class>com.ejb.session.ejbeans.StlgBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
----------------------------------------------------------------Working Fine for single and exception for multi users------------------------------------------------------------

2012-06-27 12:27:15,531 DEBUG com.ds.ApplSessListener 16 - vattributeAdded : errorencountered,java.lang.ClassCastException: java.lang.String cannot be cast to com.packg.class

Strange that its working for single user and cracking for multiuser when tested via jmeter
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've already started multiple versions of this question in other forums:https://forums.oracle.com/forums/thread.jspa?threadID=2407347&tstart=0

What happened to the advice you were given there?

1.) You can't just change EJBs from stateful to stateless without making considerations and other compensatory changes to your code.
2.) You need to find where you are doing the cast to com.packg.class either directly in your code or through some config or auto binding.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic