Error "XNIO001001: No XNIO Provider" When Deploying to Wildfly Using the Cargo Java and Jenkins APIs

I am working on a Jenkins plugin that manages the deployment of EAR files in Java EE containers using the Codehaus Cargo Java APIs, however I ran into a problem when using the API to deploy to a remote Wildfly container. The code works fine when deployed to other containers, such as Glassfish, but when you try to deploy an EAR file to the Wildfly container, an error message is returned XNIO001001: No XNIO provider found.

I spent several hours researching this problem, but I can not find anything that could solve the problem. This issue occurs when you try to deploy to Wildfly 8.1 and 8.2 running on Windows and Ubuntu. I also checked the Wildfly server log, but there is nothing related to this problem in it.

My question is , what can be done to prevent an error XNIO001001: No XNIO provider foundwhen deploying to a Wildfly container while the code is part of the Jenkins plugin?

I know that Jenkins already has a similar plugin, and that Cargo can be used with Maven for deployment in containers, but none of the options meets my specific requirements.

The code I wrote to deploy the EAR file is as follows:

public void redeploy(String containerId, String deployFile, String hostname, String username, String password) {

  DeployableFactory deployableFactory = new DefaultDeployableFactory();
  Deployable deployable = deployableFactory.createDeployable(containerId, deployFile, DeployableType.EAR);

  ConfigurationFactory configurationFactory = new DefaultConfigurationFactory();
  Configuration configuration = configurationFactory.createConfiguration(containerId, ContainerType.REMOTE, ConfigurationType.RUNTIME);
  configuration.setProperty("cargo.hostname",hostname);
  configuration.setProperty("cargo.remote.username", username);
  configuration.setProperty("cargo.remote.password", password);

  ContainerFactory containerFactory=new DefaultContainerFactory();
  Container container = containerFactory.createContainer(containerId, ContainerType.REMOTE, configuration);

  DeployerFactory deployerFactory = new DefaultDeployerFactory();
  Deployer deployer = deployerFactory.createDeployer(container);

  deployer.redeploy(deployable);
}

containerId wildfly8x, XNIO001001: No XNIO provider found :

org.codehaus.cargo.util.CargoException: Cannot deploy deployable org.codehaus.cargo.container.deployable.EAR[hello-world-ear-0.0.1-SNAPSHOT.ear]
    at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:216)
    at org.codehaus.cargo.container.spi.deployer.AbstractDeployer.redeploy(AbstractDeployer.java:245)
    at org.jenkinsci.plugins.cargo.CargoDeployer.redeploy(CargoDeployer.java:56)
    at org.jenkinsci.plugins.cargo.DeployerRedeploy.perform(DeployerRedeploy.java:97)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1769)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
Caused by: java.lang.IllegalArgumentException: XNIO001001: No XNIO provider found
    at org.xnio.Xnio.doGetInstance(Xnio.java:238)
    at org.xnio.Xnio.getInstance(Xnio.java:193)
    at org.jboss.remoting3.Remoting.createEndpoint(Remoting.java:112)
    at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:124)
    at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:67)
    at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:117)
    at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:92)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:236)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:141)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:101)
    at org.jboss.as.controller.client.helpers.standalone.impl.ModelControllerClientServerDeploymentManager.executeOperation(ModelControllerClientServerDeploymentManager.java:50)
    at org.jboss.as.controller.client.helpers.standalone.impl.AbstractServerDeploymentManager.execute(AbstractServerDeploymentManager.java:79)
    at org.codehaus.cargo.tools.jboss.JBossDeployer.executeAction(JBossDeployer.java:144)
    at org.codehaus.cargo.tools.jboss.JBossDeployer.deploy(JBossDeployer.java:84)
    at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:212)
    ... 12 more
java.lang.IllegalArgumentException: XNIO001001: No XNIO provider found
    at org.xnio.Xnio.doGetInstance(Xnio.java:238)
    at org.xnio.Xnio.getInstance(Xnio.java:193)
    at org.jboss.remoting3.Remoting.createEndpoint(Remoting.java:112)
    at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:124)
    at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:67)
    at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:117)
    at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:92)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:236)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:141)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:101)
    at org.jboss.as.controller.client.helpers.standalone.impl.ModelControllerClientServerDeploymentManager.executeOperation(ModelControllerClientServerDeploymentManager.java:50)
    at org.jboss.as.controller.client.helpers.standalone.impl.AbstractServerDeploymentManager.execute(AbstractServerDeploymentManager.java:79)
    at org.codehaus.cargo.tools.jboss.JBossDeployer.executeAction(JBossDeployer.java:144)
    at org.codehaus.cargo.tools.jboss.JBossDeployer.deploy(JBossDeployer.java:84)
    at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:212)
    at org.codehaus.cargo.container.spi.deployer.AbstractDeployer.redeploy(AbstractDeployer.java:245)
    at org.jenkinsci.plugins.cargo.CargoDeployer.redeploy(CargoDeployer.java:56)
    at org.jenkinsci.plugins.cargo.DeployerRedeploy.perform(DeployerRedeploy.java:97)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1769)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)

pom.xml

<dependency>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-core-container-wildfly</artifactId>
  <version>1.4.14</version>
</dependency>
<dependency>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-core-container-jboss</artifactId>
  <version>1.4.14</version>
</dependency>
<dependency>
  <groupId>org.wildfly</groupId>
  <artifactId>wildfly-controller-client</artifactId>
  <version>8.2.0.Final</version>
</dependency>

: , Jenkins. , Cargo EAR Wildfly.

+4
2

, xnio-api.jar, xnio-nio.jar , Jenkins. mvn dependency:tree , XNIO , .

+2

xnio-nio.jar pom.xml:

<dependency>
    <groupId>org.jboss.xnio</groupId>
    <artifactId>xnio-nio</artifactId>
    <version>3.4.6.Final</version>
</dependency>

. : https://mvnrepository.com/artifact/org.jboss.xnio/xnio-nio

+1

All Articles