2 Replies Latest reply on Aug 1, 2017 3:21 PM by George Berish

    How do I clear AbstractMethodError: org.xnio.Xnio.createWorker()?

    George Berish Novice

      My java class (run on an Eclipse Workbench) throws this error when it's main class requests an InitialContext from wildfly-10.0.1 Final also running locally with: Context ctx = Context ctx = new InitialContext(this.env);


      javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.AbstractMethodError: org.xnio.Xnio.createWorker(Ljava/lang/ThreadGroup;Lorg/xnio/OptionMap;Ljava/lang/Runnable;)Lorg/xnio/XnioWorker;]

          at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:51)

          at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:152)


      All posts I can find hint its a jar problem. Aad dding the following to my build path

      cleard up an earlier No Implementation Found Error, but left the above Error behind.





      If it helps, my WF console reports "XNIO NIO Implemention Version 3.4.0 Final"


      Can anyone point me in the direction to look for a solution?






        • 1. Re: How do I clear AbstractMethodError: org.xnio.Xnio.createWorker()?
          David Lloyd Master

          The versions of those two components must match.

          • 2. Re: How do I clear AbstractMethodError: org.xnio.Xnio.createWorker()?
            George Berish Novice

              Hi David: That worked!






            And it’s the end of a long road that began with my program throwing the infamous NoSuchMethodError because of the wrong versions of jboss related jars, then No XNIO provider found , then XNIO001001: No XNIO provider found, then the AbstractMethodError: org.xnio.Xnio.createWorker() above.


            So just in case it helps anyone just starting with Wildfly, here are:


            --- All the jars in the path that allowed my Class's constructor to finally obtain an InitialContext from a Wildfly-10.0.1 version running locally


            --- My Code (It only consists of the Properties I used and one line instantiating a new IniticalContext with them, and


            --- Console output from a successfully run.  (Note: I have my own helper methods to format the output, like P() below. But I left most of them out of the code to keep it clean.)



            (No guarantee they are all required. Next step is to remove them all and run it to determine exactly which are needed, and which are artifacts left over from all the experimentation needed to get here)
















            RELEVANT CODE:

            //Note: P()function is just a helper method I used to format the console output below.



            final private Properties env = new Properties() {

              {put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); 

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

               put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

               put(Context.SECURITY_PRINCIPAL, "guest"); 

               put(Context.SECURITY_CREDENTIALS, "guest");

               put("jboss.naming.client.ejb.context", true); 





               private JmsTestGetJNDIContext (){

                 try {

                   Context ctx = new InitialContext(this.env);

                   P (sp + iAm, "JNDI Context: " + ctx);

                 } catch (CommunicationException e) {

                   P (sp + iAm, "You forgot to start WildFly dummy!");      

                 } catch (Exception e) {

                   P (sp + iAm, "caught:  " + e.getClass().getName());

                   P (sp + iAm, e.getMessage());


                   P (iAm, "end");




            CONSOLE OUTPUT:


            JmsTestGetJNDIContext.main ()                beg

              JmsTestGetJNDIContext.<init> ()              beg

                JmsTestGetJNDIContext.<init> ()              These are Properties used to obtain IntialContext

                  "java.naming.provider.url"                   "http-remoting://localhost:9990"

                  "java.naming.factory.initial" "org.jboss.naming.remote.client.InitialContextFactory"

                  "jboss.naming.client.ejb.context"            "true"

                  "java.naming.security.principal"             "guest"

                  "java.naming.factory.url.pkgs" "org.jboss.ejb.client.naming"

                  "java.naming.security.credentials"           "guest"

                JmsTestGetJNDIContext.<init> ()              Requesting InitialContext


            Aug 01, 2017 8:32:36 AM org.xnio.Xnio <clinit>

            INFO: XNIO version 3.4.6.Final

            Aug 01, 2017 8:32:36 AM org.xnio.nio.NioXnio <clinit>

            INFO: XNIO NIO Implementation Version 3.4.3.Final

            Aug 01, 2017 8:32:36 AM org.jboss.remoting3.EndpointImpl <clinit>

            INFO: JBoss Remoting version 3.2.7.GA


                JmsTestGetJNDIContext.<init> ()              JNDI Context: javax.naming.InitialContext@3551a94

              JmsTestGetJNDIContext.<init> ()              end

            JmsTestGetJNDIContext.main ()                end