0 Replies Latest reply on Feb 28, 2020 5:21 AM by gicavallo972

    Invalid URL scheme name "http" when running remote EJB from another JBoss EAP 7.1

    gicavallo972

      Hi eveybody,

      this is my environment:

       

      Two JBoss EAP 7.1 on different machines: Backend, Frontend

      From JBoss Frontend i have a 'war' Application; here there is a simple java class with this client code:

       

      Properties jndiProperties2 = new Properties();

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

      jndiProperties2.put(Context.PROVIDER_URL,"http://<IP_BACKEND>/wildfly-services");

      jndiProperties2.put(Context.SECURITY_PRINCIPAL, "USER");

      jndiProperties2.put(Context.SECURITY_CREDENTIALS, "PASSWORD");

       

      Context context2 = new InitialContext(jndiProperties2);

       

      context2.lookup...etc. etc.

       

      This code calls an EJB (into a EAR) deployed at BACKEND JBoss EAP 7.1.

       

      If i try this client code from Eclipse Java simple Class (not deployed), ie with 'Run As with Java Application', i not have any problems with Context and remote call to EJB.

      But, the same java code into a WAR APP and Deployed at JBOSS EAP 7.1 instance, when try to call remote EJB in another JBOSS EAP 7.1 instance give this error:

       

      15:51:38,583 ERROR [stderr] (default task-15) javax.naming.InvalidNameException: WFNAM00007: Invalid URL scheme name "http"

      15:51:38,583 ERROR [stderr] (default task-15)   at org.wildfly.naming.client.WildFlyRootContext.getProviderContext(WildFlyRootContext.java:808)

      15:51:38,583 ERROR [stderr] (default task-15)   at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:140)

      15:51:38,583 ERROR [stderr] (default task-15)   at javax.naming.InitialContext.lookup(InitialContext.java:417)

      15:51:38,583 ERROR [stderr] (default task-15)   at javax.naming.InitialContext.lookup(InitialContext.java:417)

       

      The only way it works is the change in PROVIDER_URL with address and protocol like this: "remote+http": it works in client sample code application (Eclipse) and in two JBOSS EAP 7.1 instance communications.

       

      Why this? is there any configuration that i don't take into account?

       

      Thanks.