bmuschko / gradle-cargo-plugin

Gradle plugin that provides deployment capabilities to local and remote containers via Cargo
Apache License 2.0
258 stars 61 forks source link

Authentication fails with JBoss 7 #85

Closed thokari closed 10 years ago

thokari commented 10 years ago

I'm sorry for no knowing where to put this, the information on how this is supposed to work is scattered across alot of places, and also often very unclear.

I have this configuration: cargo { containerId = "jboss7x" port = 29999

remote {
    hostname = host
    username = user
    password = user
}

deployable {
    file = configurations.serverWar.artifacts.files.collect()[0]
}

deployable {
    file = configurations.portalWar.artifacts.files.collect()[0]
}

}

I get this exception:

:cargoDeployRemote JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed :cargoDeployRemote FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':cargoDeployRemote'. org.codehaus.cargo.util.CargoException: Cannot deploy deployable > org.codehaus.cargo.container.jboss.deployable.JBossWAR[masterdata_server-0.4-SNAPSHOT.war]

(Stacktrace below)

What strikes me, is that in the exception it says port 9999, regardless of what I configure in the cargo {} block. This might also be the reason this is failing, because our JBoss uses a port offset of 20000, so I would need to use port = 29999, which is what I am configuring without effect.

Caused by: java.lang.RuntimeException: java.net.ConnectException: JBAS012174: Could not connect to remote://buildse-001:9999. The connection failed at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:113) at org.jboss.as.controller.client.helpers.standalone.impl.ModelControllerClientServerDeploymentManager.executeOperation(ModelControllerClientServerDeploymentManager.java:47) at org.jboss.as.controller.client.helpers.standalone.impl.AbstractServerDeploymentManager.execute(AbstractServerDeploymentManager.java:79) at org.codehaus.cargo.tools.jboss.JBossDeployer.executeAction(JBossDeployer.java:145) at org.codehaus.cargo.tools.jboss.JBossDeployer.deploy(JBossDeployer.java:85) at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:212) ... 88 more Caused by: java.net.ConnectException: JBAS012174: Could not connect to remote://buildse-001:9999. The connection failed at org.jboss.as.protocol.ProtocolChannelClient.connectSync(ProtocolChannelClient.java:164) at org.jboss.as.protocol.mgmt.ManagementClientChannelStrategy$Establishing.getChannel(ManagementClientChannelStrategy.java:166) at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:138) at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:62) at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:106) at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:89) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:252) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:151) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:111) ... 93 more Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

bmuschko commented 10 years ago

I am pretty sure that the provided port is used. If you run the task with -i, you will see additional information (e.g. the full URL). This also works correctly with other containers like Tomcat. I suspect that the error message coming from JBoss has a hard-coded port number. This might also be a bug in the Cargo library. I'd recommend asking about this on the Cargo user mailing list.

BTW: Port offset configuration is not supported as exposed property. You'll either have to set a port number or calculate the port number in your Gradle script.

bmuschko commented 10 years ago

@thokari Oh, one more thing. You mentioned "scattered" documentation. What exactly does this relate to? To the Cargo documentation or the documentation of this plugin? If you refer to this plugin, what is confusing and how do you think it should be improved to make it better?

thokari commented 10 years ago

I was referring to the JBoss and Cargo Docs. Of course you are relying on your user to be familiar with that which makes sense. I was not referring to this plugin. Those application servers just are heavyweight beasts I guess ;) As to your answer to the problem, thank you, I will test again and look it up, once, I'm at work again.