File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 761
    
    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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception came when change stateful to stateless in ejb-jar.xml [Ejb 2.0]
 
Similar Threads
xdoclet problem while generating ejb-jar.xml
Problem looking up local interface of Session Beans - WSAD 5.1, WAS 5.0 Test Env
stateless session bean
one EJB from other EJB
accessing entity bean from session bean