4 Replies Latest reply on Sep 24, 2005 5:13 AM by breski tt

    ClassCastException:Cannot cast $Proxy73(id=2070) to org.jbos

    breski tt Newbie

      I use jboss4.0.3RC1+EJB3.0RC2.My program consist of a ejb3 archive and a war archive.I want to use one stateful session bean in the webapplication.
      The partial code:

      InitialContext ctx = new InitialContext();
      ShoppingCart cart = (ShoppingCart) ctx.lookup(ShoppingCart.class.getName());

      But I got the following exception:
      ClassCastException:Cannot cast $Proxy73(id=2070) to org.jboss.tutorial.entity.bean.ShoppingCart

      Note:the "ctx.lookup(ShoppingCart.class.getName()) " statement correctly return an object,which is $Proxy73.


      I also tried it under jboss4.0.2+ejb3RC1,but the same thing ocured.

      Can someone tell me why and how to fix the problem?