2 Replies Latest reply on Apr 27, 2009 1:23 AM by kva

    Launching JBoss AS 5.0.1 from within Eclipse

    kva

      We are using JBoss 5.0.1 and Eclipse with the latest JBoss Tools support. Launching a server from within Eclipse frequently fails with a variety of exceptions. These exceptions get logged in the log file of plugin org.jboss.ide.eclipse.as.core.

      Sometimes we see

      javax.naming.NameNotFoundException: jmx not bound
      
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
      
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
      
       at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
      
       at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
      
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
       at java.lang.reflect.Method.invoke(Method.java:597)
      
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
      
       at sun.rmi.transport.Transport$1.run(Transport.java:159)
      
       at java.security.AccessController.doPrivileged(Native Method)
      
       at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
      
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
      
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
      
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
      
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      
       at java.lang.Thread.run(Thread.java:619)
      
       at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
      
       at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
      
       at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
      
       at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
      
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
      
       at javax.naming.InitialContext.lookup(InitialContext.java:392)
      
       at org.jboss.ide.eclipse.as.core.extensions.jmx.JMXSafeRunner.run(JMXSafeRunner.java:56)
      
       at org.jboss.ide.eclipse.as.core.extensions.jmx.JMXSafeRunner.run(JMXSafeRunner.java:35)
      
       at org.jboss.ide.eclipse.as.core.extensions.polling.JMXPoller$PollerRunnable.run(JMXPoller.java:110)
      
      


      Other times we see
      javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
      
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1725)
      
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:689)
      
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
      
       at javax.naming.InitialContext.lookup(InitialContext.java:392)
      
       at org.jboss.ide.eclipse.as.core.extensions.jmx.JMXSafeRunner.run(JMXSafeRunner.java:56)
      
       at org.jboss.ide.eclipse.as.core.extensions.jmx.JMXSafeRunner.run(JMXSafeRunner.java:35)
      
       at org.jboss.ide.eclipse.as.core.extensions.polling.JMXPoller$PollerRunnable.run(JMXPoller.java:110)
      
       at java.lang.Thread.run(Thread.java:619)
      


      This all seems to be related to the JMX Poller trying to figure out if the server got launched. At the office, I usually succeed in launching within 3 attempts. At home, launching does not succeed at all.

      Any idea what is causing this? Is it a matter of timeouts not properly configured somewhere?

      Needless to say, this is very annoying.

        • 1. Re: Launching JBoss AS 5.0.1 from within Eclipse
          rob.stryker

          When the server is first starting, typically there is no connection at all from JNDI because the server hasn't even started JNDI yet. This is why you get the javax.naming.CommunicationException:

          A few seconds later, JNDI is bound, but JMX is not. JNDI responds to the request, and the request responds that, javax.naming.NameNotFoundException: jmx not bound

          To be clear, these are not failures. This is the expected flow as the server starts up.

          After a while, JMX is bound, and I get the Server mbean and ask if the server is started yet. At first, the response is no.... the server has not completed starting. When the server is completely started, however, the poller responds that the server is started, and the server's state switches to "Started" instead of "Starting".

          To be clear, is your complain that these status errors are logged? You havent' said whether or not there's a problem in the view. This is not a bug unless the server's view is not updating the server's status when the server is completely started.

          • 2. Re: Launching JBoss AS 5.0.1 from within Eclipse
            kva

            My complaint is that the server view goes from Starting to Terminated. I also see the exception below in the log of the plugin.

            org.jboss.ide.eclipse.as.core.server.IServerStatePoller$PollingException: IOE; nested exception is:
             java.net.SocketException: Connection reset
             at org.jboss.ide.eclipse.as.core.extensions.polling.JMXPoller$PollerRunnable.handleException(JMXPoller.java:172)
             at org.jboss.ide.eclipse.as.core.extensions.polling.JMXPoller$PollerRunnable.run(JMXPoller.java:112)
             at java.lang.Thread.run(Thread.java:619)
            
            !ENTRY org.jboss.ide.eclipse.as.core 1 16973825 2009-04-23 21:36:23.140
            !MESSAGE Server processes have been terminated.
            
            !ENTRY org.jboss.ide.eclipse.as.core 4 16973826 2009-04-23 21:36:23.531
            !MESSAGE The server was shutdown forcefully. All processes were terminated.