aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Exception came when change stateful to stateless in ejb-jar.xml [Ejb 2.0] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Exception came when change stateful to stateless in ejb-jar.xml [Ejb 2.0] " Watch "Exception came when change stateful to stateless in ejb-jar.xml [Ejb 2.0] " New topic
Author

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

S Test
Greenhorn

Joined: Jun 29, 2012
Posts: 1
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

Joined: Mar 17, 2012
Posts: 892
    
    9
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.
 
Don't get me started about those stupid light bulbs.
 
subject: Exception came when change stateful to stateless in ejb-jar.xml [Ejb 2.0]