Naga Vijayapuram [
http://community.jboss.org/people/nvwm] created the discussion
"Stateful EJB 3.0 - ClassCastException"
To view the discussion, visit:
http://community.jboss.org/message/540205#540205
--------------------------------------------------------------
Hello,
I am trying out a Stateful EJB 3.0 and am getting this when I try to access it from a
remote client -
$ ./Client.sh
Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference
cannot be cast to org.jboss.tutorial.stateful.bean.ShoppingCart
at org.jboss.tutorial.stateful.client.Client.main(Client.java:21)
The same client code works fine from within a jsp page.
What could be happenning? Here's the client code - it fails with above exception
during "lookup" from the remote client -
InitialContext ctx = new InitialContext();
ShoppingCart cart = (ShoppingCart) ctx.lookup("ShoppingCartBean/remote");
NOTE: Reproduced in both JBoss 5.1.0.GA and in JBoss 6 M2.
Naga Vijayapuram
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/540205#540205]
Start a new discussion in EJB 3.0 at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]