Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-2144

JMX exception creating connection to: 0.0.0.0; nested exception is: java.net.NoRouteToHostException

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.3.0
    • java-17-openjdk
    • None
    • None
    • None
    • sst_java
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat AMQ
    • None
    • None
    • None
    • x86_64
    • None

      What were you trying to do that didn't work?

      ActiveMQ Artemis (using configuration that used to work on RHEL 9.2) does not work on RHEL 9.3 Beta for me.

      2023-09-04 12:50:14,286 ERROR [org.apache.activemq.artemis.core.server.management.ManagementConnector] Can't init JMXConnectorServer:
      java.io.IOException: Cannot bind to URL [rmi://0.0.0.0:1099/jmxrmi]: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: Exception creating connection to: 0.0.0.0; nested exception is: 
              java.net.NoRouteToHostException: No route to host]
              at javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:834) ~[?:?]
              at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:481) ~[?:?]
              at org.apache.activemq.artemis.core.server.management.ConnectorServerFactory.init(ConnectorServerFactory.java:226) ~[artemis-server-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.core.server.management.ManagementConnector.start(ManagementConnector.java:95) ~[artemis-server-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.core.server.management.ManagementContext.start(ManagementContext.java:59) ~[artemis-server-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.cli.commands.Run$1.preActivate(Run.java:95) ~[artemis-cli-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.callPreActiveCallbacks(ActiveMQServerImpl.java:3071) ~[artemis-server-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart1(ActiveMQServerImpl.java:3237) ~[artemis-server-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:70) ~[artemis-server-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:716) ~[artemis-server-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:607) ~[artemis-server-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:66) ~[artemis-cli-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:129) ~[artemis-cli-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:212) ~[artemis-cli-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:162) ~[artemis-cli-2.28.0.redhat-00004.jar:2.28.0.redhat-00004]
              at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
              at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
              at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
              at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
              at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:144) ~[artemis-boot.jar:2.28.0.redhat-00004]
              at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:61) ~[artemis-boot.jar:2.28.0.redhat-00004]
      Caused by: javax.naming.CommunicationException
              at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:163) ~[?:?]
              at com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:243) ~[?:?]
              at javax.naming.InitialContext.bind(InitialContext.java:417) ~[?:?]
              at javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:693) ~[?:?]
              at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:476) ~[?:?]
              ... 19 more
      Caused by: java.rmi.ConnectIOException: Exception creating connection to: 0.0.0.0; nested exception is: 
              java.net.NoRouteToHostException: No route to host
              at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:638) ~[?:?]
              at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:217) ~[?:?]
              at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:204) ~[?:?]
              at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:344) ~[?:?]
              at sun.rmi.registry.RegistryImpl_Stub.bind(RegistryImpl_Stub.java:65) ~[?:?]
              at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:157) ~[?:?]
              at com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:243) ~[?:?]
              at javax.naming.InitialContext.bind(InitialContext.java:417) ~[?:?]
              at javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:693) ~[?:?]
              at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:476) ~[?:?]
              ... 19 more
      Caused by: java.net.NoRouteToHostException: No route to host
              at sun.nio.ch.Net.connect0(Native Method) ~[?:?]
              at sun.nio.ch.Net.connect(Net.java:579) ~[?:?]
              at sun.nio.ch.Net.connect(Net.java:568) ~[?:?]
              at sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593) ~[?:?]
              at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?]
              at java.net.Socket.connect(Socket.java:633) ~[?:?]
              at java.net.Socket.connect(Socket.java:583) ~[?:?]
              at java.net.Socket.<init>(Socket.java:507) ~[?:?]
              at java.net.Socket.<init>(Socket.java:287) ~[?:?]
              at sun.rmi.transport.tcp.TCPDirectSocketFactory.createSocket(TCPDirectSocketFactory.java:40) ~[?:?]
              at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:620) ~[?:?]
              at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:217) ~[?:?]
              at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:204) ~[?:?]
              at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:344) ~[?:?]
              at sun.rmi.registry.RegistryImpl_Stub.bind(RegistryImpl_Stub.java:65) ~[?:?]
              at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:157) ~[?:?]
              at com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:243) ~[?:?]
              at javax.naming.InitialContext.bind(InitialContext.java:417) ~[?:?]
              at javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:693) ~[?:?]
              at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:476) ~[?:?]
              ... 19 more
      

      If I replace 0.0.0.0 with 127.0.0.1, everything works fine even on RHEL 9.3 Beta.

      Please provide the package NVR for which bug is seen:

      # java --version
      openjdk 11.0.20 2023-07-18 LTS
      OpenJDK Runtime Environment (Red_Hat-11.0.20.0.8-1) (build 11.0.20+8-LTS)
      OpenJDK 64-Bit Server VM (Red_Hat-11.0.20.0.8-1) (build 11.0.20+8-LTS, mixed mode, sharing)
      
      # java --version
      openjdk 17.0.8 2023-07-18 LTS
      OpenJDK Runtime Environment (Red_Hat-17.0.8.0.7-1) (build 17.0.8+7-LTS)
      OpenJDK 64-Bit Server VM (Red_Hat-17.0.8.0.7-1) (build 17.0.8+7-LTS, mixed mode, sharing)
      

      How reproducible:

      Always, see the attached reproducer

      Steps to reproduce

      java /tmp/jmxreproducer.java
      

      Expected results

      Reproducer prints RUNNING

      Actual results

      Exception in thread "main" java.io.IOException: Cannot bind to URL [rmi://0.0.0.0:1099/jmxrmi]: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: Exception creating connection to: 0.0.0.0; nested exception is: 
              java.net.NoRouteToHostException: No route to host (Host unreachable)]
              at java.management.rmi/javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:854)
              at java.management.rmi/javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:501)
              at Scratch.main(scratch.java:23)
      Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: Exception creating connection to: 0.0.0.0; nested exception is: 
              java.net.NoRouteToHostException: No route to host (Host unreachable)]
              at jdk.naming.rmi/com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:162)
              at java.naming/com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:243)
              at java.naming/javax.naming.InitialContext.bind(InitialContext.java:417)
              at java.management.rmi/javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:713)
              at java.management.rmi/javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:496)
              at Scratch.main(scratch.java:23)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at jdk.compiler/com.sun.tools.javac.launcher.Main.execute(Main.java:404)
              at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:179)
              at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:119)
      Caused by: java.rmi.ConnectIOException: Exception creating connection to: 0.0.0.0; nested exception is: 
              java.net.NoRouteToHostException: No route to host (Host unreachable)
              at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:635)
              at java.rmi/sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:209)
              at java.rmi/sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:196)
              at java.rmi/sun.rmi.server.UnicastRef.newCall(UnicastRef.java:343)
              at java.rmi/sun.rmi.registry.RegistryImpl_Stub.bind(RegistryImpl_Stub.java:65)
              at jdk.naming.rmi/com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:156)
              ... 12 more
      Caused by: java.net.NoRouteToHostException: No route to host (Host unreachable)
              at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
              at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
              at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:253)
              at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
              at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
              at java.base/java.net.Socket.connect(Socket.java:609)
              at java.base/java.net.Socket.connect(Socket.java:558)
              at java.base/java.net.Socket.<init>(Socket.java:454)
              at java.base/java.net.Socket.<init>(Socket.java:231)
              at java.rmi/sun.rmi.transport.tcp.TCPDirectSocketFactory.createSocket(TCPDirectSocketFactory.java:40)
              at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:617)
              ... 17 more
      

              rhn-engineering-ahughes Andrew Hughes
              jdanek@redhat.com Jiri Daněk
              Andrew Hughes Andrew Hughes
              David Kutalek David Kutalek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: