Geronimo
  1. Geronimo
  2. GERONIMO-2567

Remote admin of server using deployer.jar fails to connect

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2, 2.0, 2.0.x
    • Fix Version/s: 2.0.2, 2.1
    • Component/s: deployment
    • Security Level: public (Regular issues)
    • Labels:
      None
    • Environment:

      Linux
      Java 1.5

      Description

      Trying to remote deploy a WAR file resulted in a failed connection.

      This happened regardless of whether the port was specified.

      $ java -jar deployer.jar --user system --password manager --host 172.16.1.41 redeploy ~/PaLM.war
      Error: Unable to connect to server at
      deployer:geronimo:jmx://172.16.1.41 – Connection refused to host:
      127.0.0.1; nested exception is:

      java.net.ConnectException: Connection refused

        Activity

        Hide
        Donald Woods added a comment -

        updated Fixed For field

        Show
        Donald Woods added a comment - updated Fixed For field
        Hide
        Jay D. McHugh added a comment - - edited

        Fixed in Revision: 568302/568304

        Linux notes:
        The hostname of the server needs to appear in the /etc/hosts file (on the server) with its external ip address.

        And the <geronimo-home>/var/config/config.xml file needs to have the gbean-deployer module
        updated to point to the external address (of the server).

        ie:
        <module name="org.apache.geronimo.configs/geronimo-gbean-deployer/2.1-SNAPSHOT/car">
        <gbean name="Deployer">
        <attribute name="remoteDeployAddress">http://172.16.1.2:$

        {HTTPPortPrimary + PortOffset}

        </attribute>
        </gbean>
        </module>

        Show
        Jay D. McHugh added a comment - - edited Fixed in Revision: 568302/568304 Linux notes: The hostname of the server needs to appear in the /etc/hosts file (on the server) with its external ip address. And the <geronimo-home>/var/config/config.xml file needs to have the gbean-deployer module updated to point to the external address (of the server). ie: <module name="org.apache.geronimo.configs/geronimo-gbean-deployer/2.1-SNAPSHOT/car"> <gbean name="Deployer"> <attribute name="remoteDeployAddress"> http://172.16.1.2:$ {HTTPPortPrimary + PortOffset} </attribute> </gbean> </module>
        Hide
        Jacek Laskowski added a comment -
        Show
        Jacek Laskowski added a comment - http://cwiki.apache.org/confluence/display/GMOxKB/Remote+admin+using+deployer.jar+fails+to+connect+when+IPv6+is+used Couldn't we wrap the IPv4 and IPv6 addresses with [] by default?
        Hide
        Kevan Miller added a comment -

        Check for an ipv6 numeric address and wrap with [ ]

        Show
        Kevan Miller added a comment - Check for an ipv6 numeric address and wrap with [ ]
        Hide
        Kevan Miller added a comment -

        Hey Jay,
        I think we can address with a simple code change. I'll make a change. If you could validate, that would be great...

        --kevan

        Show
        Kevan Miller added a comment - Hey Jay, I think we can address with a simple code change. I'll make a change. If you could validate, that would be great... --kevan
        Hide
        Jay D. McHugh added a comment -

        Kevan,

        You are correct - It was an IPv6 issue (I hadn't realized that I had IPv6 enabled locally).

        So, taking that into account (specifying the remote server address using the IPv4 version
        surrounded by "[ ]") and setting the remoteDeployAddress in the server's config.xml
        (server address in IPv4 surrounded by "[ ]" with the port set to 9999) allowed me to connect
        and list my modules.

        Rather than a bug, this looks like it would be better addressed in the documentation.

        Show
        Jay D. McHugh added a comment - Kevan, You are correct - It was an IPv6 issue (I hadn't realized that I had IPv6 enabled locally). So, taking that into account (specifying the remote server address using the IPv4 version surrounded by "[ ]") and setting the remoteDeployAddress in the server's config.xml (server address in IPv4 surrounded by "[ ]" with the port set to 9999) allowed me to connect and list my modules. Rather than a bug, this looks like it would be better addressed in the documentation.
        Hide
        Kevan Miller added a comment -

        1) No.
        2) Remote server

        E.g: I have a Geronimo server running on monk. I use the following command to list-modules on monk from my local machine coltrane:

        ./deploy.sh --host monk list-modules

        This works for me on G 2.0.1

        Jay, the line numbers in your stacktrace don't line up with my source (i.e. at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:159)

        I would guess that the JMXServiceURL that is being build before the connect call (my line 167) is building an unexpected url:

        JMXServiceURL address = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"params.getHost()":"params.getPort()"/JMXConnector");

        Doh. Jay do you have IPV6 enabled? That's got to be it... If we're getting a ':' separated numerical ipv6 address, we need to wrap the host with '[' ']' chars.

        Show
        Kevan Miller added a comment - 1) No. 2) Remote server E.g: I have a Geronimo server running on monk. I use the following command to list-modules on monk from my local machine coltrane: ./deploy.sh --host monk list-modules This works for me on G 2.0.1 Jay, the line numbers in your stacktrace don't line up with my source (i.e. at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:159) I would guess that the JMXServiceURL that is being build before the connect call (my line 167) is building an unexpected url: JMXServiceURL address = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" params.getHost() ":" params.getPort() "/JMXConnector"); Doh. Jay do you have IPV6 enabled? That's got to be it... If we're getting a ':' separated numerical ipv6 address, we need to wrap the host with ' [' '] ' chars.
        Hide
        Jay D. McHugh added a comment -

        I'll see if I can figure out why I can't get a connection.

        I need two questions answered to make sure that I am at least set up properly:
        1) Do I need to have a server running locally to administer a remote server (I would tend to think not)
        2) Which address should remoteDeployAddress point to? The remote server's external address or the local system's address?

        Other than those, I'll try to eliminate all other variables by statically addressing everything.

        I won't be able to look at this until either this evening or tomorrow though.

        Show
        Jay D. McHugh added a comment - I'll see if I can figure out why I can't get a connection. I need two questions answered to make sure that I am at least set up properly: 1) Do I need to have a server running locally to administer a remote server (I would tend to think not) 2) Which address should remoteDeployAddress point to? The remote server's external address or the local system's address? Other than those, I'll try to eliminate all other variables by statically addressing everything. I won't be able to look at this until either this evening or tomorrow though.
        Hide
        Kevan Miller added a comment -

        Hmmm. Somebody on user list (Rodrigo?) is having the same basic problem. However, neither Donald or I are able to recreate (I did run into a deploy problem...).

        Jay since you're able to recreate, perhaps you could dig into the problem a bit more? Or equally useful, let's figure out what's unique about your configuration...

        Show
        Kevan Miller added a comment - Hmmm. Somebody on user list (Rodrigo?) is having the same basic problem. However, neither Donald or I are able to recreate (I did run into a deploy problem...). Jay since you're able to recreate, perhaps you could dig into the problem a bit more? Or equally useful, let's figure out what's unique about your configuration...
        Hide
        Donald Woods added a comment -

        Are both machines using static IP addresses?
        I've been able to list-modules between a SLES10, RHEL4 and WinXP machine which are all on the same subnet w/ static addresses, all using Sun 1.5.0_11 and all have a server installed....
        The only thing I updated from a default install, was to update the Deployer in config.xml to set the remoteDeployAddress to the external interface, instead of using the default localhost in the deployer CAR....

        Show
        Donald Woods added a comment - Are both machines using static IP addresses? I've been able to list-modules between a SLES10, RHEL4 and WinXP machine which are all on the same subnet w/ static addresses, all using Sun 1.5.0_11 and all have a server installed.... The only thing I updated from a default install, was to update the Deployer in config.xml to set the remoteDeployAddress to the external interface, instead of using the default localhost in the deployer CAR....
        Hide
        Jay D. McHugh added a comment -

        I am still having a problem.

        Perhaps the problem is that I am trying to use the deployer incorrectly
        (I usually just use the web console to administer remote servers).

        Please let me know if I am trying to use the tool incorrectly
        (It would be nice to be able to script my redeploys).

        Configuration:
        Local system - Linux with Sun JDK 1.5.0_12
        Remote system - Linux with Sun JDK 1.5.0_8 (IP Address 172.16.1.41)
        No running firewall on either system and the web admin console works.

        When I try to list the modules running on a remote server here is the command I use
        and the resulting output:

        (with a server running locally also)
        java -jar deployer.jar --user system --password manager --host 172.16.1.41 list-modules
        Error: Unable to connect to server at
        deployer:geronimo:jmx://172.16.1.41 – no such object in table
        javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException: no such object in table
        at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:167)
        at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.getDeploymentManager(BaseDeploymentFactory.java:131)
        at javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.getDeploymentManager(DeploymentFactoryManager.java:111)
        at org.apache.geronimo.deployment.cli.ServerConnection.tryToConnect(ServerConnection.java:181)
        at org.apache.geronimo.deployment.cli.ServerConnection.<init>(ServerConnection.java:93)
        at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:158)
        at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
        at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
        at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31)
        Caused by: java.rmi.NoSuchObjectException: no such object in table
        at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
        at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
        at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source)
        at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2239)
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:271)
        at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
        at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:159)
        ... 8 more

        (without a server running locally)
        java -jar deployer.jar --user system --password manager --host 172.16.1.41 list-modules
        Error: Unable to connect to server at
        deployer:geronimo:jmx://172.16.1.41 – Connection refused to host:
        127.0.0.1; nested exception is:

        java.net.ConnectException: Connection refused
        javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException: Connection refused to host: 127.0.0.1; nested exception is:
        java.net.ConnectException: Connection refused
        at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:167)
        at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.getDeploymentManager(BaseDeploymentFactory.java:131)
        at javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.getDeploymentManager(DeploymentFactoryManager.java:111)
        at org.apache.geronimo.deployment.cli.ServerConnection.tryToConnect(ServerConnection.java:181)
        at org.apache.geronimo.deployment.cli.ServerConnection.<init>(ServerConnection.java:93)
        at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:158)
        at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
        at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
        at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31)
        Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
        java.net.ConnectException: Connection refused
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
        at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source)
        at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2239)
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:271)
        at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
        at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:159)
        ... 8 more
        Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at java.net.Socket.connect(Socket.java:469)
        at java.net.Socket.<init>(Socket.java:366)
        at java.net.Socket.<init>(Socket.java:179)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
        ... 16 more

        Show
        Jay D. McHugh added a comment - I am still having a problem. Perhaps the problem is that I am trying to use the deployer incorrectly (I usually just use the web console to administer remote servers). Please let me know if I am trying to use the tool incorrectly (It would be nice to be able to script my redeploys). Configuration: Local system - Linux with Sun JDK 1.5.0_12 Remote system - Linux with Sun JDK 1.5.0_8 (IP Address 172.16.1.41) No running firewall on either system and the web admin console works. When I try to list the modules running on a remote server here is the command I use and the resulting output: (with a server running locally also) java -jar deployer.jar --user system --password manager --host 172.16.1.41 list-modules Error: Unable to connect to server at deployer:geronimo:jmx://172.16.1.41 – no such object in table javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException: no such object in table at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:167) at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.getDeploymentManager(BaseDeploymentFactory.java:131) at javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.getDeploymentManager(DeploymentFactoryManager.java:111) at org.apache.geronimo.deployment.cli.ServerConnection.tryToConnect(ServerConnection.java:181) at org.apache.geronimo.deployment.cli.ServerConnection.<init>(ServerConnection.java:93) at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:158) at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45) at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67) at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31) Caused by: java.rmi.NoSuchObjectException: no such object in table at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126) at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source) at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2239) at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:271) at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248) at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:159) ... 8 more (without a server running locally) java -jar deployer.jar --user system --password manager --host 172.16.1.41 list-modules Error: Unable to connect to server at deployer:geronimo:jmx://172.16.1.41 – Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:167) at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.getDeploymentManager(BaseDeploymentFactory.java:131) at javax.enterprise.deploy.shared.factories.DeploymentFactoryManager.getDeploymentManager(DeploymentFactoryManager.java:111) at org.apache.geronimo.deployment.cli.ServerConnection.tryToConnect(ServerConnection.java:181) at org.apache.geronimo.deployment.cli.ServerConnection.<init>(ServerConnection.java:93) at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:158) at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45) at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67) at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31) Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94) at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source) at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2239) at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:271) at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248) at org.apache.geronimo.deployment.plugin.factories.BaseDeploymentFactory.newRemoteDeploymentManager(BaseDeploymentFactory.java:159) ... 8 more Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at java.net.Socket.<init>(Socket.java:366) at java.net.Socket.<init>(Socket.java:179) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128) at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569) ... 16 more
        Hide
        Donald Woods added a comment -

        Are you still seeing this with the 2.0.1 release? If not, can you close this issue?

        Show
        Donald Woods added a comment - Are you still seeing this with the 2.0.1 release? If not, can you close this issue?
        Hide
        Jay D. McHugh added a comment -

        Affects trunk - first tried on revision 472744 (weekly snapshot)

        Show
        Jay D. McHugh added a comment - Affects trunk - first tried on revision 472744 (weekly snapshot)

          People

          • Assignee:
            Kevan Miller
            Reporter:
            Jay D. McHugh
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development