2 Replies Latest reply on Dec 9, 2010 3:50 PM by wdfink

    Lookup bean from AS 4.0.5 to 5.1.0

    gvalenc

      I have an EJB3 stateless session bean deployed in AS 5.1.0 that I am trying to look up from some client code deployed in a remote AS 4.0.5 installation. The client isn't a true EJB client, just something that happens to be running within the context of a 3rd party EJB in that server. Should this be possible? The client has the same class files inside its jar as those in the 5.1.0 bean's jar. I specifically set the JNDI provider URL to be the remote 5.1.0 server in the InitialContext properties before lookup.

       

      I get this exception during the narrow() call:

       

      Caused by: java.lang.ClassCastException
              at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
              at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
              at com.venetica.vbr.res.ejb.EJBLocator.locateDirector(EJBLocator.java:115)
              ... 23 more
      Caused by: java.lang.ClassCastException: javax.naming.Reference
              at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
              ... 25 more

      Caused by: java.lang.ClassCastException

              at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)

              at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)

              at ****(****.java:115)

              ... 23 more

      Caused by: java.lang.ClassCastException: javax.naming.Reference

              at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)

              ... 25 more

        • 1. Re: Lookup bean from AS 4.0.5 to 5.1.0
          gvalenc

          I should mention the client jar does not have all the class files in the bean, just one of the interfaces that the bean implements (not the business interface).

          • 2. Re: Lookup bean from AS 4.0.5 to 5.1.0
            wdfink

            Mixing JBoss version 4 <=> 5 is difficult, we give up because of transaction problems (JB5 calls JB4).

            You might pack the jbossall-client.jar (for JB5 all needed client.jars) into the EAR deployed in JBoss4 with it's own classloader.

            Also you need a EJB2 Home/Remote interface of your EJB3 because the error looks like EJB2 cast.

            1 of 1 people found this helpful