-
1. Re: How do I clear AbstractMethodError: org.xnio.Xnio.createWorker()?
dmlloyd Aug 1, 2017 8:13 AM (in response to gberish)The versions of those two components must match.
-
2. Re: How do I clear AbstractMethodError: org.xnio.Xnio.createWorker()?
gberish Aug 1, 2017 3:21 PM (in response to gberish)Hi David: That worked!
xnio-nio-3.4.3.Final.jar
xnio-api-3.4.6.Final.jar
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.)
JARS:
(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)
jboss-ejb-client-1.0.19.final.jar
jboss-sasl-1.0.4.Final.jar
jboss-transaction-api_1.2_spec-1.0.0.Final.jar
wildfly-build-config-8.2.1.Final.jar
jboss-ejb-api_3.2_spec-1.0.0.Final.jar
jboss-logging-3.1.4.GA.jar
jboss-marshalling-1.4.9.Final.jar
jboss-marshalling-river-1.4.9.Final.jar
jboss-remote-naming-2.0.1.Final.jar
jboss-remoting-3.2.7.ga.jar
xnio-api-3.4.6.Final.jar
xnio-nio-3.4.3.Final.jar
RELEVANT CODE:
//Note: P()function is just a helper method I used to format the console output below.
//members
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);
}
};
//constructor
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());
e.printStackTrace();
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