0 Replies Latest reply on Sep 27, 2006 6:32 PM by forumer

    Classcastexception when accessing EJB3.0 JPA EJB

    forumer

      Using JBoss4.0.4

      This is the first time I am trying to deploy a bean using EJB3.0/JPA. I get the following error. I'd appreciate any help me in getting me going with using JPA.

      java.lang.ClassCastException: $Proxy162

      My Bean is annotated as:

      @Stateless
      @RemoteBinding(jndiBinding="ABC/FMBean/remote")
      public class FMABean implements FMALocal, FMARemote {
       @PersistenceContext(unitName="FM")
       protected EntityManager em ;
      


      In the JSP I am trying to access the bean as:

      InitialContext ctx = new InitialContext();
       Object obj = ctx.lookup("ABC/FMAAdminBean/remote");
       System.out.println("obj class ="+obj.getClass());
       fmaAdmin = (FMAAdminBean) obj;


      JNDIView in JMX Console look like:
       +- ABC (class: org.jnp.interfaces.NamingContext)
       | +- FMABean (class: org.jnp.interfaces.NamingContext)
       | | +- remote (proxy: $Proxy147 implements No ClassLoaders found for: com.boeing.begss.fm.FMARemote (no security manager: RMI class loader disabled))
       | +- FMAAdminBean (class: org.jnp.interfaces.NamingContext)
       | | +- remote (proxy: $Proxy144 implements No ClassLoaders found for: com.boeing.begss.fm.FMAAdminRemote (no security manager: RMI class loader disabled))