Could not connect to remote://localhost:9999. The connection timed out Jboss 7.1.1 Final
Asked Answered
B

2

11

I am deploying builds to local and remote Jboss AS 7.1.1 Final at port 9999. Maven uses jboss plugin 'jboss-as-maven-plugin:7.1.1.Final' to manage builds to servers. I have confirmed that server is up and running and port is accessible at 9999. But "many times" build fails with following error for both local and remote Jboss. Jboss ic configured in Standalone mode single node cluster.

Stranglely build doesn't fail every time but most of the time. Not sure if we need to upgrade Maven plugin to higher version.

[INFO] o.h.m.e.h.MavenExecutionResultHandler - Build failed with exception(s) [INFO] o.h.m.e.h.MavenExecutionResultHandler - [1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.1.1.Final:undeploy (default-cli) on project Test: Error executing UNDEPLOY [DEBUG] Closing connection to remote [ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.1.1.Final:undeploy (default-cli) on project Test: Error executing UNDEPLOY: java.net.ConnectException: JBAS012144: Could not connect to remote://localhost:9999. The connection timed out -> [Help 1]

UPDATE

<plugin>
   <groupId>org.jboss.as.plugins</groupId>
   <artifactId>jboss-as-maven-plugin</artifactId>
   <version>7.1.1.Final</version>
   <configuration>
     <filename>${project.build.finalName}.jar</filename>
     <username>${userName}</username>
     <password>${password}</password>
   </configuration>
</plugin>

I am now using latest version of Maven plug-in but it seems that connection timeout error is more frequent now. I am starting to think if Jboss behaves differently when trying to make too many remote deployment with different sub projects of the application. I am having 21 sub projects being deployed from a master POM. Sample configuration is as follows

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.master</groupId>
    <artifactId>master</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>
    <name>Master</name>
    <url>http://maven.apache.org</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <modules>
        <module>module1</module>
        <module>module2</module>
        <module>module3</module>
        <module>module4</module>
        <module>module5</module>
        <module>module6</module>
        <module>module7</module>
        <module>module8</module>
        <module>module9</module>
        <module>module10</module>
        <module>module11</module>
        <module>module12</module>
        <module>module13</module>
    </modules>
Brand answered 2/4, 2013 at 6:42 Comment(10)
if the server is up, this may be the case after port settings have been changed (assuming this is a standalone deployment, this would be in the standalone.xml).Lagrange
If I completely understand your comment, you meant port has been changed from 9999 to something else. If so, then this is not the case, port is 9999 always. Maven is trying to deploy different OSGI component and frequency of failing to deploy/undeploy at exactly same deployable is remote, it fails at any given deployment.Brand
I see. another issue could be that you are not providing a valid username and/or password for the management port. Could you post the jboss-as-maven-plugin configuration for remote deployment from your pom?Lagrange
Please find POM configuration in orignal question. Also I am sending correct username/password while running Maven command with -Dusername and -Dpassword parameters. I think if I don't provide or give incorrect user identity it gives me authentication failure error.Brand
You might want to try using a newer release of the plugin. The current release is 7.4.Final.Starflower
I am now using latest version of Maven plug-in but it seems that error is now more frequent with 21 different projects I am trying to build and deploy as part of one master configuration. Could it be related to more number of project during single deployment?Brand
I've ran it across all the JBoss JDF Quickstarts before and never had an issue.Starflower
I've this problem too, but in the OpenShift environment.Hydrops
I'm using 7.6.Final and still hitting this issue randomly.Dawdle
Is the JBoss enabled to accept remote connections? By adding a public interface in the standalone.xml?Moonshine
P
1

First, check plugin configuration. For example:

    <plugin>
        <groupId>org.jboss.as.plugins</groupId>
        <artifactId>jboss-as-maven-plugin</artifactId>
        <version>7.9.Final</version>
        <inherited>true</inherited>
        <configuration>
            <hostname>${jboss.hostname}</hostname>
            <port>${jboss.port}</port>
            <username>${jboss.user}</username>
            <password>${jboss.pass}</password>
            <timeout>30000</timeout>
        </configuration>
    </plugin>

If hostname, port number(default 9999), username and password are ok, you can try increasing "timeout" (default is 5000ms, you can try with 30000ms). It worked for me.

Panslavism answered 16/12, 2017 at 1:46 Comment(2)
Did not work for me. I increased the timeout to one hour and it does not wait one hour to raise the timeout exceptionSentimentalism
- Did you verify if your configuration is valid and is not an access problem? - Have you defined a port offset in your standalone.xml? Is the administration port still 9999? Can you verify that in your logs? - Do you have binding your server to the same IP number that you configured in pom.xml?Panslavism
A
0

4 Possible Solutions to Question

  1. Remove your Local Cache settings which will be your local m2 repo Or Point to new m2 repo from your maven settings.xml file.
  2. Try to connect to your local nexus/archiva (if any other) using relevant/appropriate credentials.It is only your Maven Plugin causing this problem.
  3. Try to use the latest JBoss Deploy Plugin available in this link.

  4. Alternatively check your windows/Linux firewall settings have been enabled or it.

Abrahan answered 22/1, 2016 at 9:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.