8 Replies Latest reply on Oct 30, 2017 1:12 PM by Roger Lee

    WildFly 11.0.0.Final - Remote JNDI lookup: javax.naming.OperationNotSupportedException: WFNAM00026: No provider for found for URI: ejb

    Roger Lee Apprentice

      Migrated from 10.1.0.Final to 11.0.0.Final. Everything runs fine when I was using my 10.1.0.Final Client at access the EJBs deployed on 11.0.0.Final.

       

      However when I migrated to a WildFly 11 client using the new "org.wildfly.naming.client.WildFlyInitialContextFactory" etc I get:

       

      ejb:MigrationTool/MigrationToolJAR/MigrationToolBean!uk.co.magdalene.migrationtool.interfaces.MigrationToolRemote

      Oct 30, 2017 10:54:31 AM org.xnio.Xnio <clinit>

      INFO: XNIO version 3.5.4.Final

      Oct 30, 2017 10:54:31 AM org.xnio.nio.NioXnio <clinit>

      INFO: XNIO NIO Implementation Version 3.5.4.Final

      Oct 30, 2017 10:54:32 AM org.jboss.remoting3.EndpointImpl <clinit>

      INFO: JBoss Remoting version 5.0.5.Final

      >>>>> NamingException = javax.naming.OperationNotSupportedException: WFNAM00026: No provider for found for URI: ejb

       

      Any ideas?

       

      TIA

       

      run from:

       

      ORG_WILDFLY=/usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/modules/system/layers/base/org/wildfly
      ORG_JBOSS=/usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/modules/system/layers/base/org/jboss
      ARTIFACTS=/Users/NOTiFY/IdeaProjects/MigrationTool/out/artifacts/MigrationToolJAR
      $JAVA_HOME/jre/bin/java -cp $ARTIFACTS/MigrationToolJAR.jar:$ORG_WILDFLY/naming-client/main/wildfly-naming-client-1.0.7.Final.jar:$ORG_WILDFLY/security/elytron-private/main/wildfly-elytron-1.1.6.Final.jar:$ORG_WILDFLY/common/main/wildfly-common-1.2.0.Final.jar:$ORG_JBOSS/xnio/main/xnio-api-3.5.4.Final.jar:$ORG_JBOSS/xnio/nio/main/xnio-nio-3.5.4.Final.jar:$ORG_JBOSS/remoting/main/jboss-remoting-5.0.5.Final.jar:$ORG_WILDFLY/client/config/main/wildfly-client-config-1.0.0.Final.jar:$ORG_JBOSS/logging/main/jboss-logging-3.3.1.Final.jar:$ORG_WILDFLY/org/wildfly/http-client/common/main/wildfly-http-client-common-1.0.8.Final.jar:$ORG_WILDFLY/http-client/naming/main/wildfly-http-naming-client-1.0.8.Final.jar:$ORG_WILDFLY/http-client/transaction/main/wildfly-http-transaction-client-1.0.8.Final.jar uk.co.magdalene.migrationtool.client.MigrationToolClient -v
      

       

      Client code:

       

       

      public final class MigrationToolClient {
      
         private static final int ZERO = 0;
         private static final int ONE = 1;
      
         /**
        *
        */
         private MigrationToolRemote migrationToolRemote;
      
         /**
        *
        */
         private MigrationToolClient() {
        }
      
         /**
        * @return MigrationToolRemote
        * @throws NamingException NamingException
        */
         public static MigrationToolRemote lookupMigrationToolRemote() throws NamingException {
        Hashtable<String, String> jndiProperties = new Hashtable();
        jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");
        jndiProperties.put(Context.PROVIDER_URL, "http://localhost:8080");
      
        Context context = new InitialContext(jndiProperties);
      
         final String appName = "";
         final String moduleName = "MigrationTool/MigrationToolJAR";
         final String distinctName = "";
         final String beanName = MigrationToolBean.class.getSimpleName();
      
         final String viewClassName = MigrationToolRemote.class.getName();
      
        MigrationToolRemote migrationToolRemote = (MigrationToolRemote) context.lookup("ejb:" + "/" + moduleName + '/' + beanName + '!' + viewClassName);
      
         return migrationToolRemote;
        }
      
         /**
        * @param args String[]
        */
         public static void main(final String[] args) {
        String parameter = null;
        System.out.println(">>>>> parameter # " + args.length + " = " + parameter);
      
         switch (args.length) {
         case ONE:
        parameter = args[ZERO].toUpperCase();
        System.out.println(">>>>> parameter = " + parameter);
         break;
         default:
        System.err.println(">>>>> INVALID number of parameters .....");
         break;
        }
      
        MigrationToolClient migrationToolClient = new MigrationToolClient();
      
        MigrationToolRemote migrationToolRemote = null;
      
         try {
        migrationToolRemote = migrationToolClient.lookupMigrationToolRemote();
        System.out.println(">>>>> migrationToolRemote = " + migrationToolRemote);
        } catch (NamingException ne) {
        System.err.println(">>>>> NamingException = " + ne);
        }
        }
      }
      
        • 1. Re: WildFly 11.0.0.Final - Remote JNDI lookup: javax.naming.OperationNotSupportedException: WFNAM00026: No provider for found for URI: ejb
          Farah Juma Apprentice

          Looks like $ORG_JBOSS/ejb-client/main/jboss-ejb-client-4.0.7.Final.jar is missing from the classpath (the NamingContextFactory for JNDI names that start with "ejb:" is provided in jboss-ejb-client-4.0.7.Final.jar).

          • 2. Re: WildFly 11.0.0.Final - Remote JNDI lookup: javax.naming.OperationNotSupportedException: WFNAM00026: No provider for found for URI: ejb
            Roger Lee Apprentice

            Thanks for that. It has moved me on a few steps. Now have:

             

            $JAVA_HOME/jre/bin/java -cp $ARTIFACTS/MigrationToolJAR.jar:$ORG_WILDFLY/naming-client/main/wildfly-naming-client-1.0.7.Final.jar:$ORG_WILDFLY/security/elytron-private/main/wildfly-elytron-1.1.6.Final.jar:$ORG_WILDFLY/common/main/wildfly-common-1.2.0.Final.jar:$ORG_JBOSS/xnio/main/xnio-api-3.5.4.Final.jar:$ORG_JBOSS/xnio/nio/main/xnio-nio-3.5.4.Final.jar:$ORG_JBOSS/remoting/main/jboss-remoting-5.0.5.Final.jar:$ORG_WILDFLY/client/config/main/wildfly-client-config-1.0.0.Final.jar:$ORG_JBOSS/logging/main/jboss-logging-3.3.1.Final.jar:$ORG_JBOSS/ejb-client/main/jboss-ejb-client-4.0.7.Final.jar:$ORG_WILDFLY/org/wildfly/http-client/common/main/wildfly-http-client-common-1.0.8.Final.jar:$ORG_WILDFLY/http-client/naming/main/wildfly-http-naming-client-1.0.8.Final.jar:$ORG_WILDFLY/http-client/transaction/main/wildfly-http-transaction-client-1.0.8.Final.jar:$JAVAX/transaction/api/main/jboss-transaction-api_1.2_spec-1.0.1.Final.jar:$JAVAX/ejb/api/main/jboss-ejb-api_3.2_spec-1.0.0.Final.jar:$ORG_JBOSS/marshalling/main/jboss-marshalling-2.0.2.Final.jar:$ORG_WILDFLY/discovery/main/wildfly-discovery-client-1.0.0.Final.jar uk.co.magdalene.migrationtool.client.MigrationToolClient -v

             

            Which causes:

             

            Oct 30, 2017 2:31:21 PM org.jboss.ejb.client.legacy.ElytronLegacyConfiguration getConfiguredAuthenticationContext

            INFO: EJBCLIENT000069: Using legacy jboss-ejb-client.properties security configuration

            Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.jboss.ejb.client.TransactionInterceptor

              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

              at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

              at org.jboss.ejb.client.EJBClientInterceptorInformation.getInterceptorInstance(EJBClientInterceptorInformation.java:66)

              at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:569)

              at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)

              at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:907)

              at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:165)

              at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:100)

              at com.sun.proxy.$Proxy0.runMigrationTool(Unknown Source)

              at uk.co.magdalene.migrationtool.client.MigrationToolClient.runMigrationToolClient(MigrationToolClient.java:105)

              at uk.co.magdalene.migrationtool.client.MigrationToolClient.main(MigrationToolClient.java:192)

            MacBook-Pro:MigrationTool NOTiFY$

            • 3. Re: WildFly 11.0.0.Final - Remote JNDI lookup: javax.naming.OperationNotSupportedException: WFNAM00026: No provider for found for URI: ejb
              Roger Lee Apprentice

              My error was running against my "old" WildFly 10 client.

               

              Using the WildFly 11 client (as original posting). The remote interface is null.

               

              ***** lookupMigrationToolRemote migrationToolRemote = Proxy for remote EJB StatelessEJBLocator for "/MigrationTool/MigrationToolJAR/MigrationToolBean", view is interface uk.co.magdalene.migrationtool.interfaces.MigrationToolRemote, affinity is None

              >>>>> migrationToolRemote = Proxy for remote EJB StatelessEJBLocator for "/MigrationTool/MigrationToolJAR/MigrationToolBean", view is interface uk.co.magdalene.migrationtool.interfaces.MigrationToolRemote, affinity is None

              >>>>> runMigrationToolClient() migrationToolRemote = null

              >>>>> runMigrationToolClient() parameter = -V

              >>>>> Exception runMigrationToolClient = null

              • 4. Re: WildFly 11.0.0.Final - Remote JNDI lookup: javax.naming.OperationNotSupportedException: WFNAM00026: No provider for found for URI: ejb
                Farah Juma Apprentice

                Just noticed the following line in your client code:

                 

                jndiProperties.put(Context.PROVIDER_URL, "http://localhost:8080");
                

                 

                The Context.PROVIDER_URL should be "remote+http://localhost:8080".

                • 5. Re: WildFly 11.0.0.Final - Remote JNDI lookup: javax.naming.OperationNotSupportedException: WFNAM00026: No provider for found for URI: ejb
                  Roger Lee Apprentice

                  When I use:

                   

                  jndiProperties.put(Context.PROVIDER_URL, "http+remoting://localhost:8080");

                   

                  I get:

                   

                  ORG_WILDFLY = ORG_WILDFLY

                  ORG_JBOSS = /usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/modules/system/layers/base/org/jboss

                  ARTIFACTS = /Users/NOTiFY/IdeaProjects/MigrationTool/out/artifacts/MigrationToolJAR

                  >>>>> parameter # 1 = null

                  >>>>> parameter = -V

                  Oct 30, 2017 4:04:06 PM org.wildfly.naming.client.Version <clinit>

                  INFO: WildFly Naming version 1.0.7.Final

                  Oct 30, 2017 4:04:06 PM org.wildfly.security.Version <clinit>

                  INFO: ELY00001: WildFly Elytron version 1.1.6.Final

                  >>>>> 1 appName =

                  >>>>> 2 moduleName = MigrationTool/MigrationToolJAR

                  >>>>> 3 distinctName =

                  >>>>> 4 beanName = MigrationToolBean

                  >>>>> 5 viewClassName = uk.co.magdalene.migrationtool.interfaces.MigrationToolRemote

                  >>>>> 6 = ejb:MigrationTool/MigrationToolJAR/MigrationToolBean!uk.co.magdalene.migrationtool.interfaces.MigrationToolRemote

                  Oct 30, 2017 4:04:06 PM org.xnio.Xnio <clinit>

                  INFO: XNIO version 3.5.4.Final

                  Oct 30, 2017 4:04:06 PM org.xnio.nio.NioXnio <clinit>

                  INFO: XNIO NIO Implementation Version 3.5.4.Final

                  Oct 30, 2017 4:04:06 PM org.jboss.ejb.client.legacy.RemotingLegacyConfiguration getConfiguredEndpoint

                  INFO: EJBCLIENT000070: Using legacy jboss-ejb-client.properties Remoting configuration

                  Oct 30, 2017 4:04:06 PM org.jboss.remoting3.EndpointImpl <clinit>

                  INFO: JBoss Remoting version 5.0.5.Final

                  Oct 30, 2017 4:04:06 PM org.jboss.ejb.client.legacy.ElytronLegacyConfiguration getConfiguredAuthenticationContext

                  INFO: EJBCLIENT000069: Using legacy jboss-ejb-client.properties security configuration

                  >>>>> NamingException = javax.naming.InvalidNameException: WFNAM00007: Invalid URL scheme name "http+remoting"

                   

                  In  Coding a Remote EJB Project for WildFly 11

                   

                  It refers to:

                  gException {

                          final Hashtable jndiProperties = new Hashtable();

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

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

                          final Context ctx = new InitialContext(jndiProperties);

                           

                   

                          return (Account) ctx

                                  .lookup("ejb:/javaee7-ejb-server-basic/AccountEJB!com.itbuzzpress.chapter4.ejb.Account?stateful");

                      }

                   

                  Which gives:

                   

                   

                  ORG_WILDFLY = ORG_WILDFLY

                  ORG_JBOSS = /usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/modules/system/layers/base/org/jboss

                  ARTIFACTS = /Users/NOTiFY/IdeaProjects/MigrationTool/out/artifacts/MigrationToolJAR

                  >>>>> parameter # 1 = null

                  >>>>> parameter = -V

                  Oct 30, 2017 4:10:27 PM org.wildfly.naming.client.Version <clinit>

                  INFO: WildFly Naming version 1.0.7.Final

                  Oct 30, 2017 4:10:27 PM org.wildfly.security.Version <clinit>

                  INFO: ELY00001: WildFly Elytron version 1.1.6.Final

                  >>>>> 1 appName =

                  >>>>> 2 moduleName = MigrationTool/MigrationToolJAR

                  >>>>> 3 distinctName =

                  >>>>> 4 beanName = MigrationToolBean

                  >>>>> 5 viewClassName = uk.co.magdalene.migrationtool.interfaces.MigrationToolRemote

                  >>>>> 6 = ejb:MigrationTool/MigrationToolJAR/MigrationToolBean!uk.co.magdalene.migrationtool.interfaces.MigrationToolRemote

                  Oct 30, 2017 4:10:27 PM org.xnio.Xnio <clinit>

                  INFO: XNIO version 3.5.4.Final

                  Oct 30, 2017 4:10:27 PM org.xnio.nio.NioXnio <clinit>

                  INFO: XNIO NIO Implementation Version 3.5.4.Final

                  Oct 30, 2017 4:10:27 PM org.jboss.ejb.client.legacy.RemotingLegacyConfiguration getConfiguredEndpoint

                  INFO: EJBCLIENT000070: Using legacy jboss-ejb-client.properties Remoting configuration

                  Oct 30, 2017 4:10:27 PM org.jboss.remoting3.EndpointImpl <clinit>

                  INFO: JBoss Remoting version 5.0.5.Final

                  Oct 30, 2017 4:10:27 PM org.jboss.ejb.client.legacy.ElytronLegacyConfiguration getConfiguredAuthenticationContext

                  INFO: EJBCLIENT000069: Using legacy jboss-ejb-client.properties security configuration

                  Oct 30, 2017 4:10:27 PM org.jboss.ejb.client.EJBClient <clinit>

                  INFO: JBoss EJB Client version 4.0.7.Final

                  ***** lookupMigrationToolRemote migrationToolRemote = Proxy for remote EJB StatelessEJBLocator for "/MigrationTool/MigrationToolJAR/MigrationToolBean", view is interface uk.co.magdalene.migrationtool.interfaces.MigrationToolRemote, affinity is None

                  >>>>> migrationToolRemote = Proxy for remote EJB StatelessEJBLocator for "/MigrationTool/MigrationToolJAR/MigrationToolBean", view is interface uk.co.magdalene.migrationtool.interfaces.MigrationToolRemote, affinity is None

                  >>>>> runMigrationToolClient() migrationToolRemote = null

                  >>>>> runMigrationToolClient() parameter = -V

                  >>>>> Exception runMigrationToolClient = null

                  • 6. Re: WildFly 11.0.0.Final - Remote JNDI lookup: javax.naming.OperationNotSupportedException: WFNAM00026: No provider for found for URI: ejb
                    Farah Juma Apprentice

                    "remote+http" is the protocol name that should now be used for remoting connections. However, "http-remoting" should still work though. Maybe try adding TRACE level logging for things like org.wildfly.security and org.jboss.remoting to see if that helps reveal more info.