1 Reply Latest reply on Feb 14, 2018 6:53 AM by bouka

    Problem with local JNDI Lookup jboss-eap-7.1

    bouka Newbie

      Hi,

       

      I have in an Eclipse EJB-Project a remote bean with an interface annotated with "@Remote"

       

      @Remote

      public interface SessionBeanLocalStatelessIF {

          void addMember(String memberName);

          List<String> getMembers();

      }

       

      The initial context is definied as following:

       

      Properties properties = new Properties();

      properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.wildfly.naming.client.WildFlyInitialContextFactory");

      properties.put(Context.PROVIDER_URL, "http-remoting://localhost:8080"); 

      properties.put(Context.SECURITY_PRINCIPAL, "User");

      properties.put(Context.SECURITY_CREDENTIALS, "Password");

      initialContext = new InitialContext(properties);

       

      The jndi name is

      "ejb:"+appName+"/"+moduleName+"/"+ distinctName +"/"+beanName+"!"+interfaceName;

       

      I had no problem to invoke/run it. But when I change the Remote bean to Local, I get the error:"javax.naming.NameNotFoundException: global -- service jboss.naming.context.java.jboss.exported.global"

       

      The initial context is the same as before. Only the interface has now the "@Local" annotation:

       

      @Local

      public interface SessionBeanLocalStatelessIF {

          void addMember(String memberName);

          List<String> getMembers();

      }

       

      The client is in the same app as the bean. I tried all the published JNDI-Names existing in the server log without success:

       

      java:global/ExempleEJBSessionBean/SessionBeanLocalStateless!com.ejb.local.SessionBeanLocalStatelessIF

      java:app/ExempleEJBSessionBean/SessionBeanLocalStateless!com.ejb.local.SessionBeanLocalStatelessIF

      java:module/SessionBeanLocalStateless!com.ejb.local.SessionBeanLocalStatelessIF

      java:global/ExempleEJBSessionBean/SessionBeanLocalStateless

      java:app/ExempleEJBSessionBean/SessionBeanLocalStateless

      java:module/SessionBeanLocalStateless

       

      Could anyone help me understand, what's the problem here? Thank's in advance !