Junv
Junv

Reputation: 530

jboss-as-maven-plugin can't deploy to remote JBoss AS7?

I've tried for days to use jboss-as-maven-plugin to deploy web projects to remote JBoss AS7, but it didn't 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 to localhost without <configuration>, even no <username> and <password>.

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

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

It works too, but by changing <hostname> to point to my other computer (in the same router) it doesn't work but that computer receives a request, and the request is cut by something. (I thought it may be JBoss)

The error message in 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 is JBoss as 7.1.0 is not allowed remote deploy?

For some security issues?

Upvotes: 8

Views: 26235

Answers (9)

Adnan Khan
Adnan Khan

Reputation: 1111

This issue usually occurs due to binding address of your JBOSS, if you will take a look at standlone.xml the jboss management bind address is

jboss.bind.address.management:127.0.0.1

You can change it to the machine IP adress or point it to 0.0.0.0

jboss.bind.address.management:0.0.0.0/machine IP

restart JBOSS and try mvn jboss plugin should work like a charm.

Upvotes: 0

Samir Shaik
Samir Shaik

Reputation: 1095

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

Upvotes: 1

roz
roz

Reputation: 124

what worked for me was to change from jboss-as 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

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

Upvotes: 6

Hanuman
Hanuman

Reputation: 968

When I got the same error by using IntelliJ I undeployed the project from JBoss server and again deployed it is working fine.

Upvotes: 0

Mitja Gustin
Mitja Gustin

Reputation: 1791

Remote deployment definitely works.

  1. Be sure that management port (native) is bound to *.9999, as mentioned above .

    <socket-binding name="management-native" interface="management" port="${*:9999}"/>
    
  2. Be sure that you added user to management realm. Also, I noticed that password was cached the first time I ran plugin, so later on it keep using stale password (from first run) instead of new one. I notice this using mvn -X option.

  3. I also turned off firewall on jboss server host machine. At least ports 8787, 4447, 8080, 9990 must be opened.

Here is complete 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 everyting with :

mvn package jboss-as:deploy

Upvotes: 1

joaolsouzajr
joaolsouzajr

Reputation: 351

I solved this problem, using the last version of plugin:

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

Upvotes: 1

fascynacja
fascynacja

Reputation: 2880

For me worked changing the version of the maven plugin to the newer:

 <version>7.1.0.Final</version>

Upvotes: 0

Sandro
Sandro

Reputation: 1845

For me it worked when configuring the plugin with the hostname parameter "127.0.0.1" as the server seems to bind to that IP 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>

Upvotes: 1

dma_k
dma_k

Reputation: 10639

It is definitely not a security issue.

The plugin you are referring uses the JBoss AS7 ability to deploy applications using the Server Deployment Manager (this is new feature in AS7). Previously the deployment was only possible via JMX console, which required the deployment artifact to be reachable by server (local file or URL).

You need to make sure:

  • 192.168.1.104 is running JBoss AS7 with Server Deployment Manager listening on port 9999.
  • The port should not be bound to localhost iface (not 127.0.0.0:9999 but *:9999).
  • There is no firewall between you and 192.168.1.104 rejecting packets to port 9999.

Upvotes: 6

Related Questions