Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Explained
    • Affects Version/s: 20.0.0.Final
    • Fix Version/s: None
    • Component/s: EJB
    • Labels:
      None
    • Steps to Reproduce:
      • Start server
      • Wait for server
      • Start client (remote+http work fine, pure http cause exception)
    • Affects:
      Compatibility/Configuration
    • Release Notes Text:
      Mark it as resolved. Feel free to reopen if you still see problems.

      Description

      Java SE code:

      public class Application {
       private static final String REMOTE_CALC = "ejb:/remote-ejb/RemoteCalc!" + RemoteCalc.class.getName();
      
      /**
       * Lookup remote \{@link RemoteCalc}.
       * 
       * @return a \{@link RemoteCalc} object
       * @throws NamingException Something is wrong
       */
       public static RemoteCalc getRemoteCalc() throws NamingException {
       Hashtable<String, Object> jndiProps = new Hashtable<>();
       jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");
       // remote+http connection (work fine)
       //jndiProps.put(Context.PROVIDER_URL, "remote+http://127.0.0.1:8080/remote-ejb");
       // http connection (fail)
       jndiProps.put(Context.PROVIDER_URL, "http://127.0.0.1:8080/wildfly-services");
       Context context = new InitialContext(jndiProps);
      
      return (RemoteCalc) context.lookup(REMOTE_CALC);
       }
      
      /**
       * Call to run (main).
       * 
       * @param args parameters (not used)
       * @throws NamingException Something is wrong
       */
       public static void main(String[] args) throws NamingException {
       
       RemoteCalc remoteCalc = getRemoteCalc();
       System.out.println("Remote calc 95 + 76: " + remoteCalc.add(95, 76));
       }
      }
      

      Exception:
      Exception in thread "main" javax.naming.InvalidNameException: WFNAM00007: Invalid URL scheme name "http"
      at org.wildfly.naming.client.WildFlyRootContext.getProviderContext(WildFlyRootContext.java:808)
      at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:140)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at com.bosch.emea.bpart.remoteejbclient.Application.getRemoteCalc(Application.java:34)
      at com.bosch.emea.bpart.remoteejbclient.Application.main(Application.java:47)

      Lib:

      @Remote
      public interface RemoteCalc {
       /**
       * Add two integer.
       * 
       * @param a an integer
       * @param b an integer
       * @return a + b
       */
       public int add(int a, int b);
       
      }
      

      Config:

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
       <authentication-client xmlns="urn:elytron:1.0">
       <authentication-rules>
       <rule use-configuration="default" />
       </authentication-rules>
       <authentication-configurations>
       <configuration name="default">
       <sasl-mechanism-selector selector="#ALL" />
       <set-mechanism-properties>
       <property key="wildfly.sasl.local-user.quiet-auth" value="true" />
       </set-mechanism-properties>
       <providers>
       <use-service-loader/>
       </providers>
       </configuration>
       </authentication-configurations>
       </authentication-client>
      </configuration>
      

      Maven dependency:

      <dependency>
       <groupId>org.wildfly</groupId>
       <artifactId>wildfly-ejb-client-bom</artifactId>
       <version>20.0.0.Final</version>
       <type>pom</type>
      </dependency>
      

       

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                cfang Cheng Fang
                Reporter:
                theonlinewolf Gergely Moln√°r
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: