Graham Stewart
Graham Stewart

Reputation: 21

remote deployment to wildfly using cargo fails

I am trying to deploy an application to a remote wildfly 8.1.0.Final using the cargo maven plugin and it fails with error Operation failed: Could not connect to remote://10.0.0.165:9990 in 5000ms.

The application is the default application generated by the maven archetype cargo-archetype-remote-deployment. This application can be successfully deployed to jboss 7.1.1.Final without modification to the pom. I have added the following profile to the pom

<profile>
  <id>wildfly8x</id>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.cargo</groupId>
          <artifactId>cargo-maven2-plugin</artifactId>
          <configuration>
            <container>
              <containerId>wildfly8x</containerId>
            </container>
          <properties>
             <!--<cargo.jboss.management-native.port>9999</cargo.jboss.management-native.port>-->
             <cargo.jboss.management-http.port>9990</cargo.jboss.management-http.port>  
          </properties>

          </configuration>
          <!--
            The JBoss remote deployer requires some additional dependencies. Read more on:
            http://cargo.codehaus.org/JBoss+Remote+Deployer
            -->
          <dependencies>
            <dependency>
              <groupId>org.jboss.as</groupId>
              <artifactId>jboss-as-controller-client</artifactId>
              <version>7.0.2.Final</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</profile>

which is a copy of the jboss7x profile with the changes for wildfly.

The properties at the beginning have been changed to correct hostname and username and passwords. I can log into the 10.0.0.165:9990 using http and access the web interface I can also us the jboss-cli interface to login to 10.0.0.165:9990 and deploy the application to the server using the command line. I have also increased the time out as recommended but without success.

It would appear that the remote:// protocol is not available in wildfly or the name is incorrect and cargo is expecting to be able to connect using it.

I have had problems with wildfly and the changes made to interfaces in the past when I connected Netbeans 8 to it. I did eventually find the solution to that by adding back the native management interface which was removed in one of the beta versions.

Does anybody have any knowledge on how to get this working? A copy of a pom from a working example would be good. Before replying please make sure that your reply is relevant to the versions specified as jboss/redhat make changes between dot point releases with very little documentation.

Upvotes: 0

Views: 1347

Answers (1)

NFRiaCowboy
NFRiaCowboy

Reputation: 303

Hy,

I just have the same issue, i gues you copy the example from:

http://cargo.codehaus.org/JBoss+Remote+Deployer

And I found that the example is for JBOSS 7...

For Wildfly this is what worked for me:

<build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.4.12</version>
                <configuration>
                    <container>
                        <containerId>wildfly8x</containerId>
                        <type>remote</type>
                    </container>
                    <configuration>
                        <type>runtime</type>
                        <properties>
                            <cargo.remote.username>consoleUser</cargo.remote.username>
                            <cargo.remote.password>consolePassword</cargo.remote.password>
                            <cargo.hostname>IP_ADDRESS</cargo.hostname>
                            <cargo.jboss.management-http.port>9990</cargo.jboss.management-http.port>
                        </properties>
                    </configuration>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.wildfly</groupId>
                        <artifactId>wildfly-controller-client</artifactId>
                        <version>8.2.0.Final</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

The shame on this is the documentation and that no java people community have answer this post... have to be a .NET guy... what a shame....

Upvotes: 2

Related Questions