based on the trailblazer online examples, i setup a super simple stateless
session bean (TestSLSB) and a stateful session bean(TestSFSB). note: using
jboss 4.0.3sp1.
they both show up in the jndi output, and the stateless works like a champ, but
the stateful keeps throwing classcast exceptions on lookup?
java.lang.ClassCastException: $Proxy70
what is wrong, is the trailblazer example incorrect?
| import java.io.Serializable;
|
| import javax.ejb.Init;
| import javax.ejb.Local;
| import javax.ejb.Stateful;
| import org.jboss.annotation.ejb.LocalBinding;
|
| @Stateful
| @Local ({TestSFSBIF.class})
| @LocalBinding (jndiBinding="gwig/TestSFSBLocal")
| public class TestSFSB implements TestSFSBIF,Serializable
| {
| private int count = 0;
|
| public String getInfo()
| {
| count++;
| return "counter is ..."+count;
| }
|
| public int getCount(){return count;}
|
| @Init
| public void init()
| {
| count=70;
| }
| }
|
i use this in my servlet client:
| TestSFSBIF testF = null;
| try {
| InitialContext ctx = new InitialContext();
| testF = (TestSFSBIF) ctx.lookup("gwig/TestSFSBLocal");
| }catch (Exception e) {
| ...
|
here is my jndi snippet:
| +- gwig (class: org.jnp.interfaces.NamingContext)
| | +- TestSLSBLocal (proxy: $Proxy75 implements No ClassLoaders found
for: com.gwig.ejb.TestSLSBIF (no security manager: RMI class loader disabled))
| | +- TestSFSBLocalStatefulProxyFactory (class:
org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
| | +- TestSFSBLocal (class: java.lang.Object)
|
thanks.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3931744#3931744
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3931744
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user