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

    Wildfly calling ejb 2 hosted on jboss 4.0.5

    Thomas Newman Newbie

      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.