1 Reply Latest reply on Jun 16, 2008 3:44 PM by alxs.alxs.gmx.de

    Accessing 2.x EJBs in external app from POJO

    alxs.alxs.gmx.de

      Hi,


      I'm trying to access a 2.x EJB in an external Application deployed in the same JBoss 4.0.5 server from a Seam 2.0.2 managed POJO.


      Here is the code I usually use to create a reference to a Bean:


      InitialContext initial = new InitialContext();
      Object objref = initial.lookup("ejb/UserManager");
                      
      UserManagerHome home =  (UserManagerHome) PortableRemoteObject.narrow(objref, UserManagerHome.class);
                          
      UserManager userManager = home.create();
      



      When executing this code in a Seam managed POJO (not EJB) I get a ClassCastException because the lookup returns a Proxy-Object, that doesn't seem to have any type I know.


      Do I have to set up a reference in any of my deployment descriptors?


      Thanks,
      Alex