# Gradle cargo plugin port server not reached

**URL:** <https://discuss.gradle.org/t/gradle-cargo-plugin-port-server-not-reached/21418>\
**Category:** Help/Discuss\
**Created:** [February 1, 2017, 9:03am UTC](https://discuss.gradle.org/t/gradle-cargo-plugin-port-server-not-reached/21418 "2017-02-01T09:03:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeusdi](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jeusdi](https://discuss.gradle.org/u/jeusdi)\
**Post date:** [February 1, 2017, 9:03am UTC](https://discuss.gradle.org/t/gradle-cargo-plugin-port-server-not-reached/21418/1 "2017-02-01T09:03:23Z")

</div>

I’m getting this message:

> 14:23:42.135 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@26b625127 pairs: {POST /management/add-content HTTP/1.1: null} **{Connection: close}** {Content-Type: multipart/form-data; boundary=CargoBoundary}{User-Agent: Java/1.8.0\_45} **{Host: localhost:9990}** {Accept: text/html, image/gif, image/jpeg, \*; q=.2, _/_; q=.2}{Content-Length: 29831794}  
> …

Nevertheless, my task sets the port to connect to is 9992 instead of used 9990!  
So, the connection is refused! How could I change the port?

```
def remoteContainers = [
	new RemoteContainer(
		name: 'wildfly10',
		container: 'wildfly10x',
		hostname: 'localhost',
		port: 9992,
		username: '----',
		password: '----',
        purpose: 'development'
	)
]

remoteContainers.each { config ->
	task "deployDev${config.name.capitalize()}"(type: com.bmuschko.gradle.cargo.tasks.remote.CargoDeployRemote) {
		description = "Deploys WAR to remote Web Application Server: '${config.name}'."
		containerId = config.container
		hostname = config.hostname
		port = config.port
		username = config.username
		password = config.password
		context = "webapi"
		dependsOn = [createDevelopmentWar]
	}
}

```

I’ve just realized that I’m getting different messages when I’m using `--debug` and `--info`.

When I perform `gradle deployDevWildfly10 --info` I’m getting this message:

> Deployable artifacts = [D:\projects\living\platform\commty\build\dists\commty-dev-de31042.war]  
> Starting action ‘deploy’ for remote container ‘wildfly10x’ on **‘[http://localhost:9992](http://localhost:9992)’**  
> Container properties = [:]  
> :deployDevWildfly10 FAILED

Otherwise, using `gradle deployDevWildfly10 --debug` I’m getting these messages:

> 08:30:20.505 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@5b565a527 pairs: {POST /management/add-content HTTP/1.1: null}{Connection: close}{Content-Type: multipart/form-data; boundary=CargoBoundary}{User-Agent: Java/1.8.0\_45}{Host: **localhost:9990** }{Accept: text/html, image/gif, image/jpeg, \*; q=.2, _/_; q=.2}{Content-Length: 29832076}  
> 08:30:20.627 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@4a857f181 pairs: {Content-type: unknown/unknown}  
> 08:30:20.627 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ‘:deployDevWildfly10’  
> 08:30:20.627 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :deployDevWildfly10 FAILED

This is my last [gradle script](https://gist.github.com/jeusdi/fddccbee40d30f1d4181de42d0da0f2c).

Any ideas?

---

<div class="post-metadata">

**Author:** ![bmuschko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/bmuschko/32/5458_2.png) [@bmuschko](https://discuss.gradle.org/u/bmuschko)\
**Post date:** [February 1, 2017, 3:43pm UTC](https://discuss.gradle.org/t/gradle-cargo-plugin-port-server-not-reached/21418/2 "2017-02-01T15:43:46Z")

</div>

See discussion on [https://github.com/bmuschko/gradle-cargo-plugin/issues/162](https://github.com/bmuschko/gradle-cargo-plugin/issues/162).

---

<div class="post-metadata">

**Author:** ![jeusdi](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jeusdi](https://discuss.gradle.org/u/jeusdi)\
**Post date:** [February 6, 2017, 3:11pm UTC](https://discuss.gradle.org/t/gradle-cargo-plugin-port-server-not-reached/21418/3 "2017-02-06T15:11:12Z")

</div>

Dear @bmuschko I’ve changed what you re commenting me:

```
remoteContainers.each { config ->
task "deployDev${config.name.capitalize()}"(type: com.bmuschko.gradle.cargo.tasks.remote.CargoDeployRemote) {
	description = "Deploys WAR to remote Web Application Server: '${config.name}'."
	containerId = config.container
	hostname = config.hostname
	port = config.port
	username = config.username
	password = config.password
	context = "webapi"
	dependsOn = [createDevelopmentWar]
	deployables = [new com.bmuschko.gradle.cargo.convention.Deployable(file: createDevelopmentWar.archivePath)]
	containerProperties['cargo.jboss.management-http.port', 9992]
} 

```

Nevertheless, I seems cardo is trying to connect to 9990 instead of 9992.

Any ideas?
