Cannot deploy jboss-as-maven-plugin on remote JBoss AS7?

I tried for several days to use jboss-as-maven-plugin to deploy web projects on a remote JBoss AS7, but this did not work.

Here is my pom.xml :

 <!-- JBoss Application Server --> <plugin> <groupId>org.jboss.as.plugins</groupId> <artifactId>jboss-as-maven-plugin</artifactId> <version>7.1.0.CR1b</version> <executions> <execution> <phase>install</phase> <goals> <goal>deploy</goal> </goals> <!-- Only remote server needs --> <configuration> <hostname>192.168.1.104</hostname> <port>9999</port> <username>admin</username> <password>admin123</password> </configuration> </execution> </executions> </plugin> 

Using this configuration, I can deploy localhost without a <configuration> , even without a <username> and <password> .

To expand my real IP address, I changed $ {JBOSS_HOME} /configuration/standlone.xml , changing jboss.bind.address from 127.0.0.1 to 0.0.0.0 (to decouple the JBoss address), so I can deploy projects using:

 <configuration> <!-- 192.168.1.106 is my ip --> <hostname>192.168.1.06</hostname> <port>9999</port> </configuration> 

It works, but changing <hostname> to another computer (in the same router), it does not work, but this computer receives a request, and the request is cut by something. (I thought it could be JBoss)

The error message in the Maven console is as follows:

  INFO: JBoss Remoting version 3.2.0.CR8 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 30.572s [INFO] Finished at: Fri Feb 10 23:41:25 CST 2012 [INFO] Final Memory: 18M/170M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.1.0. CR1b:deploy (default) on project MessagePushX-RELEASE: Could not execute goal de ploy on MessagePush.war. Reason: java.net.ConnectException: JBAS012144: Could no t connect to remote://192.168.1.104:9999. The connection timed out -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit ch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please rea d the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

Who can tell me that JBoss, like 7.1.0, is not allowed for remote deployment?

For some security issues?

+7
source share
8 answers

This is definitely not a security issue.

The plugin you refer to uses the JBoss AS7 feature to deploy applications using the server deployment manager (this is a new feature in AS7). Previously, deployment was only possible through the JMX console, which required that the deployment artifact be available to the server (local file or URL).

You need to make sure:

  • 192.168.1.104 JBoss AS7 is running with the server deployment manager listening on port 9999.
  • The port should not bind to localhost iface (not 127.0.0.0:9999, but *: 9999).
  • There is no firewall between you and server 192.168.1.104 that drops packets on port 9999.
+6
source

what worked for me is the transition from jboss plugin to wildfly plugin:

  <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> <version>1.1.0.Alpha8</version> </plugin> 

and then using the maven command:

 mvn wildfly:deploy 

link: https://issues.jboss.org/browse/WFLY-3684

+3
source

For me, this worked when configuring the plugin with the host name parameter "127.0.0.1", since the server seems to bind to this IP address by default:

  <plugin> <groupId>org.jboss.as.plugins</groupId> <artifactId>jboss-as-maven-plugin</artifactId> <version>7.3.Final</version> <configuration> <hostname>127.0.0.1</hostname> </configuration> </plugin> </plugins> </build> 

+1
source

Remote deployment definitely works.

  • Verify that the management port (native) is associated with * .9999, as described above.

     <socket-binding name="management-native" interface="management" port="${*:9999}"/> 
  • Make sure you add the user to the management area. In addition, I noticed that the password was cached the first time the plugin was launched, so later it will use an outdated password (from the first start) instead of a new one. I notice this with the mvn -X option.

  • I also disabled the firewall on the jboss host server. You must open ports 8787, 4447, 8080, 9990.

Here is the full plugin declaration

 <plugin> <groupId>org.jboss.as.plugins</groupId> <artifactId>jboss-as-maven-plugin</artifactId> <version>7.6.Final</version> <executions> <execution> <goals> <goal>deploy</goal> </goals> <phase>install</phase> </execution> </executions> <configuration> <force>true</force> <hostname>IP</hostname> <port>9999</port> <username>mvndeploy</username> <password>pa##word1.</password> <filename>${project.build.finalName}</filename> </configuration> </plugin> 

Test with:

 mvn package jboss-as:deploy 
+1
source

For me, it worked with changing the version of the maven plugin to a new one:

  <version>7.1.0.Final</version> 
0
source

I solved this problem using the latest version of the plugin:

 <plugin> <groupId>org.jboss.as.plugins</groupId> <artifactId>jboss-as-maven-plugin</artifactId> <version>7.5.Final</version> </plugin> 
0
source

When I received the same error using IntelliJ, I did not deploy the project from the JBoss server and deployed again, it works fine.

0
source

Use wildfly-maven-plugin instead of jboss-maven-plugin.

0
source

All Articles