3 Replies Latest reply on Oct 22, 2015 6:09 AM by paolo.barberis.73

    No matching XNIO provider found

    paolo.barberis.73

      Hi everybody,

       

      I'm trying to call an EJB deployed on JBoss 6.3 EAP, from an external jar (basically it is a batch running outside of JBoss).

      I put in the lib directory of jar and also in MANIFEST of jar the xnio-api and xnio-nio jars.

       

      But at runtime, when I make the call I always get the:

       

      java.lang.IllegalArgumentException: No matching XNIO provider found
          at org.xnio.Xnio.doGetInstance(Xnio.java:192)
          at org.xnio.Xnio.getInstance(Xnio.java:158)
          at org.jboss.remoting3.Remoting.createEndpoint(Remoting.java:73)
          at org.jboss.ejb.client.remoting.EndpointPool.getEndpoint(EndpointPool.java:81)
          at org.jboss.ejb.client.remoting.RemotingEndpointManager.getEndpoint(RemotingEndpointManager.java:49)
          at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:133)
          at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:115)
          at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47)
          at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:271)
          at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)
          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:176)
          at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
          at com.sun.proxy.$Proxy0.CleanBlackListReport(Unknown Source)
          at com.xxx.xxx.xxx.Task.executeTask(ReportTask.java:765)
      

       

      This is what I have in my classpath:

       

      log4j-1.2.13.jar

      og4j-1.2.13.jar

      xstream-1.1.2.jar

      tm-tool.jar

      spring.jar

      spring-hibernate3.jar

      xstream-1.1.2.jar

      tm-tool.jar

      spring.jar

      spring-hibernate3.jar

      ojdbc14_g.jar

      mail.jar

      logkit-1.2.jar

      jta.jar

      jsch-0.1.21.jar

      jCookie.jar

      jcj-context.jar

      jboss-client.jar

      jakarta-oro-2.0.6.jar

      jacorb-2.2.4.jar

      hsqldb.jar

      hibernate3.jar

      ehcache-1.1.jar

      dom4j-1.6.1.jar

      csv.jar

      const-66.0.jar

      commons-net-1.4.1.jar

      commons-logging.jar

      commons-lang-2.0.jar

      commons-digester.jar

      commons-collections.jar

      commons-beanutils.jar

      cglib-nodep-2.1_3.jar

      blacksun-fireant.jar

      myejb-client-66.0.jar

      avalon-framework-4.1.5.jar

      ant-nodeps.jar

      antlr-2.7.5H3.jar

      ant-launcher.jar

      ant-jsch.jar

      ant-apache-log4j.jar

      ant-1.6.5-src.zip

      ant-1.6.5.jar

      activation.jar

      xnio-nio-3.0.0.GA.jar

      xnio-api-3.0.0.GA.jar           

        • 1. Re: No matching XNIO provider found
          jaysensharma

          the "jboss-client.jar"  which you will get from "jboss-eap-6.3/bin/client"  already contains all the  XNIO related stuff which are needed for the client, So you should not try to include the  "xnio-nio-3.0.0.GA.jar" or "xnio-api-3.0.0.GA.jar" APIs separately on the client classpath.  Try removing those jars from client classpath.

           

          Can you also let us what kind of ejb client code are you using ?

          • 2. Re: No matching XNIO provider found
            jaysensharma

            Can you please post the complete stackTrace?

             

            Also are you using Spring Based EJB Client?   It also looks like you are getting the xnio JARs from outside (community jar) where as this jar is also offered by JBoss EAP

             

            So if you really want to use this jar then  add "xnio-nio-3.0.10.GA-redhat-1.jar" jar in the client classpath. This jar is usually present inside "jboss-eap-6.3/modules/system/layers/base/org/jboss/xnio/nio"

            For maven based project this JAR can be retrieved from: https://maven.repository.redhat.com/techpreview/all/org/jboss/xnio/xnio-nio/3.0.10.GA-redhat-1/

            • 3. Re: No matching XNIO provider found
              paolo.barberis.73

              I tried to:

              • remove both jars --> same exception
              • put ONLY the specific EAP jar --> same result

               

              Some more details:

               

              the call is made like this:

               

              LookupUtil.lookup(EjbRemote.class,EjbRemote.JNDI_NAME).doSomething();
              
              

               

              The EjbRemote class is:

               

              import javax.ejb.Remote;
              
              @Remote
              public interface EjbRemote {
              
                  public static final String JNDI_NAME = "ejb:services/server-ejb/server/EjbRemoteBean!com.xxx.services.ejbserver.EjbRemote";
                  void doSomething();
              }
              

               

              and the look method from my utility class is:

               

              public static <T> T lookup(Class<T> clazz, String jndiName) {
                      Object bean = lookup(jndiName);
                      return clazz.cast(PortableRemoteObject.narrow(bean, clazz));
                  }
                 
                  public  static Object lookup(String jndiName) {
                      Context context = null;
              
                      Properties props = new Properties();
                      props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
              
              
                      try {
                          context = new InitialContext(props);
                          if ( JBOSS_RUNS_STANDALONE && jndiName.startsWith( "ejb:" ) ) {
                              jndiName = removeServerGroupFromJNDI( jndiName );
                          }
                          return context.lookup(jndiName);
                      } catch (NamingException ex) {
                          throw new IllegalStateException(String.format("Can't lookup bean '%s'", jndiName), ex);
                      } finally {
                          try {
                              if (context != null) {
                                  context.close();
                              }
                          } catch (NamingException ex) {
                              throw new IllegalStateException("Can't close InitialContext", ex);
                          }
                      }
                  }
              
                  private static String removeServerGroupFromJNDI( String jndiName ) {
                      String [] parts = jndiName.split( "/" );
                      if( parts.length != 4 ) {
                          throw new IllegalArgumentException( "JNDI name should be in format: \"ejb:ear-name/jar-name/distinct-server-name/BeanName!InterfaceName\". The given jndi name is: " + jndiName );
                      }
                      String jndiWithoutServerGroup = parts[0] + "/" + parts[1] + "//" + parts[3];
                      return jndiWithoutServerGroup;
                  }