0

I would like to use Cargo to deploy my maven generated war file to a remote JBoss Server that is already running.

I have configured my pom.xml like this:

    ...
        <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-controller-client</artifactId>
                    <version>7.1.0.Final</version>
                </dependency>
            </dependencies>

            <configuration>
                <!-- Container configuration -->
                <container>
                    <timeout>300000</timeout> <!-- 5 minutes -->
                    <containerId>jboss71x</containerId>
                    <type>remote</type>
                </container>

                <!-- Configuration to use with the container -->
                <configuration>
                    <type>runtime</type>
                    <properties>
                        <cargo.hostname><myIP></cargo.hostname>
                        <cargo.jboss.management.port>9999</cargo.jboss.management.port>
                        <cargo.remote.username><myUser></cargo.remote.username>
                        <cargo.remote.password><myPass></cargo.remote.password>
                    </properties>
                </configuration>
                <!-- Deployer configuration -->
                <deployer>
                    <type>remote</type>
                </deployer>

                <!-- Deployables configuration -->
                <deployables>
                    <deployable>
                        <groupId>de.<myGroup></groupId>
                        <artifactId><myArtifact></artifactId>
                        <type>war</type>
                        <pingURL>http://<myIP>:8080/<myContextPath></pingURL>
                        <pingTimeout>60000</pingTimeout>
                    </deployable>
                </deployables>

            </configuration>
        </plugin>
    ...

Of course all variables of the form <my...> are filled out with the real values.

If I run this with the maven command:

mvn -X cargo:deploy

The maven console says:

...
Sep 12, 2012 5:06:12 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.3.GA
Sep 12, 2012 5:06:12 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.2.GA
[DEBUG] [swordCallbackHandler] Responded to a RealmCallback
[DEBUG] [swordCallbackHandler] Responded to a NameCallback
[DEBUG] [swordCallbackHandler] Responded to a PasswordCallback
[INFO] [Boss7xRemoteDeployer] The deployment has failed: org.codehaus.cargo.util.CargoException: Cannot deploy deployable org.codehaus.cargo.container.jboss.deployable.JBossWAR[myWar.war]
...

On the running JBoss server I can see a logging message in the console like this:

17:07:24,197 ERROR [org.jboss.remoting.remote.connection] (Remoting "pc09:MANAGEMENT" read-1) JBREM000200: Remote connection failed: java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen.

(sorry for the german inside of the log. It basically says: An existing connection was closed by the remote host.)

Does anybody have an idea what could be wrong or how I could get more debug info from cargo to find out what exactly the problem is?

BTW: I have used the JBoss CLI access to that Jboss Server for Arquillian tests so I am pretty confident that the access to that Jboss server via CLI should be ok.

EDIT: Seems like I have to undeploy first. To reassure that the access to the CLI works I just connected to it using the jboss-cli.bat. Then I just coincidentally undeployed the existing war and after that the deployment via cargo started to work. (Can I close this question or mark it as resolved in any way?)

Jens
  • 6,243
  • 1
  • 49
  • 79
  • 1
    There is also a jboss-as-maven-plugin that will also deploy your application. https://docs.jboss.org/jbossas/7/plugins/maven/latest/ – James R. Perkins Sep 12 '12 at 21:47
  • I had a look at this before but was not able to find any documentation on remote deploying - so I looked further and came across cargo. Does the JBoss plugin support remote deploying? – Jens Sep 13 '12 at 06:51
  • Indeed it does. You just have to set the and in your configuration (https://docs.jboss.org/jbossas/7/plugins/maven/latest/deploy-mojo.html). Optionally you can add a username and password too. In future releases you'll be able to pass -Djboss-as.hostname too. – James R. Perkins Sep 13 '12 at 14:56
  • Thx for the info. I guess I overlooked that. – Jens Sep 14 '12 at 10:26
  • Not a problem. Hopefully there should be a new release of it today with some extra goodies :-) (today being 2012-09-14) – James R. Perkins Sep 14 '12 at 15:36

0 Answers0