arun-gupta / docker-java

Docker for Java Developers
386 stars 230 forks source link

Deploy Application Using Management API #74

Open arun-gupta opened 9 years ago

arun-gupta commented 9 years ago

Sent the following message to @maxandersen and @xcoulon

Trying to deploy an application to WildFly using remote management API from JBDS as described at: blog http://blog.arungupta.me/deploy-wildfly-docker-eclipse/.

Server status changes from "Stopped, Synchronized" to "Started", and not "Started, Synchronized". This worked as shown in the blog. What could be different? 
maxandersen commented 9 years ago

this was caused by wrong hostname, right ?

arun-gupta commented 9 years ago

No that was for deployment using shared volumes as explained at: https://github.com/javaee-samples/docker-java/blob/master/chapters/docker-deployment-options.adoc#configure-jboss-developer-studio

This is using the management API as explained at: https://github.com/javaee-samples/docker-java/blob/master/chapters/docker-deployment-options.adoc#deploy-application-using-management-api

maxandersen commented 9 years ago

okey but by description it looks exactly same.

Beyond hostname also be sure you have managemement enabled on the running server and the ports forwarded.

arun-gupta commented 9 years ago

Complete steps are listed at: https://github.com/javaee-samples/docker-java/blob/master/chapters/docker-deployment-options.adoc#deploy-application-using-management-api

maxandersen commented 9 years ago

@robstryker can you take a look at this ?

arun-gupta commented 9 years ago

@robstryker any updates?

robstryker commented 9 years ago

Sorry, didn't get a chance yet. Will look into it.

robstryker commented 9 years ago

@arun-gupta : I just followed the process outlined in your sample. Upon publish, I get the following error in JBT: JBossTools is unable to verify that the server is up and responsive. java.io.IOException: java.net.ConnectException: WFLYPRT0053: Could not connect to http-remoting://172.17.0.6:9990. The connection failed

If I dig deeper in the error-log view, I see many "caused-by" exceptions, the last one being

Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed: DIGEST-MD5: Server rejected authentication at org.jboss.remoting3.remote.ClientConnectionOpenListener.allMechanismsFailed(ClientConnectionOpenListener.java:114) at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:393)

When I go via command-line to a local wf9 installation (wf9 cr1), and run jboss-cli.sh, and "connect 172.17.0.6:9990" I get the following error:

Unable to authenticate against controller at 172.17.0.6:9990: Authentication failed: all available authentication mechanisms failed: DIGEST-MD5: Server rejected authentication

So, IMO, considering the jboss-cli.sh is giving me basically the same error as my UI, I would suggest that maybe your docker image isn't set up with the proper username / password combination?

robstryker commented 9 years ago

One other thing you should note: "dockerhost" only works on Mac. For linux, you must actually find the IP address. You can do this by running docker inspect --format '{{ .NetworkSettings.IPAddress }}' CONTAINER_ID where the container id can be found via docker ps -a

This is important to note if you want your example to work for other OS other than mac.

maxandersen commented 9 years ago

@robstryker dockerhost is not specific to mac at all. dockerhost on OSX like linux and windows need to be setup in /etc/hosts like any other host name. No magic here.