0 Replies Latest reply on Oct 22, 2018 4:38 AM by MAURICE FARAMELLI

    javax.naming.NameNotFoundException: global -- service jboss.naming.context.java.jboss.exported.global

    MAURICE FARAMELLI Newbie

      Hi,

       

      I want to migrate from glassfish to jboss but am currently stuck at a very early stage. The example below works perfectly with glassfish 14 and to my opinion should work with jboss.

      I however get an error (I reproduced below)

       

      Any help would be greatly appreciated

      .

       

      Excerpts from the jndi.properties file

      java.naming.provider.url=http-remoting://127.0.0.1:8080

      java.naming.factory.initial=org.wildfly.naming.client.WildFlyInitialContextFactory

      businessHomeLookup=java:global/BusinessCommunicationS/BusinessInterTierCommunicationS/BusinessInterTier!lu.xservice.businesscommunication.fw.BusinessInterTierRemote

       

       

      Excerpts from the ClientApp

      try {
      InitialContext context = new InitialContext(); 
      this.home = (BusinessInterTierRemote) context.lookup((String) context.getEnvironment().get("businessHomeLookup"));
      } catch (javax.naming.NamingException jne) {
      jne.printStackTrace();
      }

       

      Excerpts from the wildfly server.log

          java:global/BusinessCommunicationS/BusinessInterTierCommunicationS/BusinessInterTier!lu.xservice.businesscommunication.fw.BusinessInterTierLocal

          java:app/BusinessInterTierCommunicationS/BusinessInterTier!lu.xservice.businesscommunication.fw.BusinessInterTierLocal

          java:module/BusinessInterTier!lu.xservice.businesscommunication.fw.BusinessInterTierLocal

          ejb:BusinessCommunicationS/BusinessInterTierCommunicationS/BusinessInterTier!lu.xservice.businesscommunication.fw.BusinessInterTierLocal

          java:global/BusinessCommunicationS/BusinessInterTierCommunicationS/BusinessInterTier!lu.xservice.businesscommunication.fw.BusinessInterTierRemote

          java:app/BusinessInterTierCommunicationS/BusinessInterTier!lu.xservice.businesscommunication.fw.BusinessInterTierRemote

          java:module/BusinessInterTier!lu.xservice.businesscommunication.fw.BusinessInterTierRemote

          java:jboss/exported/BusinessCommunicationS/BusinessInterTierCommunicationS/BusinessInterTier!lu.xservice.businesscommunication.fw.BusinessInterTierRemote

          ejb:BusinessCommunicationS/BusinessInterTierCommunicationS/BusinessInterTier!lu.xservice.businesscommunication.fw.BusinessInterTierRemote

       

      Excerpts from the server side app

      package lu.xservice.businesscommunication.fw;

      The Interface

      public interface BusinessInterTier {

          Collection processCRUD(BusinessCompValueHolder businessCompValueHolder);

          Collection processRead(BusinessCompValueHolder businessCompValueHolder);

          Collection process(BusinessCompValueHolder businessCompValueHolder);

      }

      The Remote Interface

      package lu.xservice.businesscommunication.fw;

      import javax.ejb.Remote;

      @Remote

      public interface BusinessInterTierRemote extends BusinessInterTier {

          @Override

          Collection processCRUD(BusinessCompValueHolder businessCompValueHolder);

          @Override

          Collection processRead(BusinessCompValueHolder businessCompValueHolder);

          @Override

          Collection process(BusinessCompValueHolder businessCompValueHolder);

      }

      The Local Interface

      package lu.xservice.businesscommunication.fw;

      import javax.ejb.Local;

      @Local

      public interface BusinessInterTierLocal extends BusinessInterTier {

          @Override

          Collection processCRUD(BusinessCompValueHolder businessCompValueHolder);

          @Override

          Collection processRead(BusinessCompValueHolder businessCompValueHolder);

          @Override

          Collection process(BusinessCompValueHolder businessCompValueHolder);

      }

      The Bean Class

      package lu.xservice.businesscommunication.fw;

      import javax.ejb.Stateless;

      @Stateless(name="BusinessInterTier")

      public class BusinessInterTierBean implements BusinessInterTierRemote, BusinessInterTierLocal {

          @Override

          public Collection processCRUD(BusinessCompValueHolder businessCompValueHolder) {

              return new BusinessDelegate().processCRUD(businessCompValueHolder);

          }

          @Override

          public Collection processRead(BusinessCompValueHolder businessCompValueHolder) {

              return new BusinessDelegate().processList(businessCompValueHolder);

          }

          @Override

          public Collection process(BusinessCompValueHolder businessCompValueHolder) {

              return new BusinessDelegate().processByMethod(businessCompValueHolder);

          }

      }

       

      The error is

      javax.naming.NameNotFoundException: global -- service jboss.naming.context.java.jboss.exported.global

          at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)

          at org.wildfly.naming.client.remote.RemoteServerTransport.handleLookup(RemoteServerTransport.java:185)

          at org.wildfly.naming.client.remote.RemoteServerTransport$1.handleMessage(RemoteServerTransport.java:106)

          at org.jboss.remoting3.remote.RemoteConnectionChannel.lambda$handleMessageData$3(RemoteConnectionChannel.java:430)

          at org.jboss.remoting3.EndpointImpl$TrackingExecutor.lambda$execute$0(EndpointImpl.java:949)

          at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)

          at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)

          at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)

          at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)

          at java.lang.Thread.run(Unknown Source)