3 Replies Latest reply on Jun 3, 2015 9:04 AM by ctomc

    Linkage error while getting XnioWorker from connection

    mikayel.nersisyan

      Hello everyone,

      I'm using Wildfly 8.1.

      In my project in pom.xml file i have following

              ...

          <dependency>

              <groupId>org.jboss.xnio</groupId>

              <artifactId>xnio-api</artifactId>

              <version>3.2.2.Final</version>    

          </dependency>

       

          <dependency>

              <groupId>org.jboss.xnio</groupId>

              <artifactId>xnio-nio</artifactId>

              <version>3.2.2.Final</version>

          </dependency>

          <dependency>

             <groupId>io.undertow</groupId>

             <artifactId>undertow-servlet</artifactId>

             <version>1.0.15.Final</version>

          </dependency>

       

              ...

       

      In source code I'am getting XnioWorker and XnioExecutor like this:

       

          serverExchange.getIoThread()

          serverExchange.getConnection().getWorker()

      where serverExchange is io.undertow.server.HttpServerExchange.

       

      When trying to get XNioWorker following exception occures:

       

      UT005023: Exception handling request to /rest/profile/: java.lang.LinkageError: loader constraint violation: when resolving method "io.undertow.server.ServerConnection.getWorker()Lorg/xnio/XnioWorker;" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, com/ats/SessionPersistenceStorage, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for resolved class, io/undertow/server/ServerConnection, have different Class objects for the type ker; used in the signature

       

      Can anyone please suggest me the solution?