3 Replies Latest reply on Apr 28, 2014 3:50 PM by psevestre

    Wildfly calling ejb 2 hosted on jboss 4.0.5

    istomisgood

      I have a jboss 4.0.5 server that provides an ejb 2 interface. I need to access this from Wildfly CR1.

       

      I have tried many variations based on ( NoClassDefFoundError when call EJB 2.1 in AS7 )

       

      My wildfly deployment is

      ear/

           lib <- this contains jbossall-client.4.0.5GA.jar

           META-INF <- this contains jboss-deployment-structure.xml

           ejb32 <- this is trying to connect to ejb 2 hosted on jboss 4.0.5.

       

      jboss-deployment-structure.xml:

       

      <jboss-deployment-structure>

          <sub-deployment name="ejb32">

              <exclusions>

                  <module name="org.picketbox" />

              </exclusions>

              <dependencies>

                  <module name="deployment.jbossallclient405" />

              </dependencies>

          </sub-deployment>

          <module name="deployment.jbossallclient405">

              <resources>

                  <resource-root path="lib/jbossall-client-4.0.5.GA.jar">

                  </resource-root>

              </resources>

          </module>

      </jboss-deployment-structure>

       

      jndi lookup in ejb32 :

       

      Properties env = new Properties();

      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");

      env.put(Context.PROVIDER_URL, "localhost:1199");

       

      InitialContext initialContext = new InitialContext(env);

       

      Object home = initialContext.lookup(SessionStoreBeanHome.JNDI_NAME);

      SessionStoreBeanHome storeHome = (SessionStoreBeanHome) PortableRemoteObject.narrow(home, SessionStoreBeanHome.class);

      SessionStoreBeanRemote sessionStoreBeanRemote = storeHome.create();

       

       

      This gives the error:

      Caused by: java.lang.IllegalAccessError: tried to access field org.jnp.interfaces.NamingParser.syntax from class org.jnp.interfaces.NamingContextFactory

      Is jbossall-client-4.0.5 not coded in a java 7 suitable way?

       

       

      If I remove jboss-deployment-structure.xml I get

      Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.security.SecurityAssociation

      I assume this is because org.picketbox provided by wildfly containts this class.

       

      Is it possible to connect from Wildfly to jboss 4.0.5 without jbossall-client.jar?

       

      Any help is much appreciated.

       

      Regards,

      Thomas.

        • 1. Re: Wildfly calling ejb 2 hosted on jboss 4.0.5
          wdfink

          Not sure, I did not tried to invoke such old implementation.

          But what if you exclude the org.picketbox from your deployment-structure?

          • 2. Re: Wildfly calling ejb 2 hosted on jboss 4.0.5
            istomisgood

            I have tried removing picketbox.

             

            As per the jboss-deployment-structure.xml above I have tried both

            <exclusions>

                 <module name="org.picketbox" />

            </exclusions>

             

            and I have tried removing this block.

             

            I suspect org.jnp.interfaces.NamingParser found in jbossall-client is not playing nice in Wildfly.

             

            I have started to investigate acheiving my goal with the jbosgi-installer-2.1.0.jar. This apparently is targeted to Wildfly Beta1 and will not work with CR1.

             

            I still need to find out how to communicate between an osgi bundle and my java ee code.

            • 3. Re: Wildfly calling ejb 2 hosted on jboss 4.0.5
              psevestre

              I´m facing exactly the same problem.

               

              Has anyone  had  better luck with this one ? I´m considering ditching EJB calls between servers and switch to SOAP or even CORBA, since interoperability with different vendors/versions does not seem to be a priority to AppServer vendors.