8 Replies Latest reply on Mar 8, 2012 3:39 AM by maxandersen

    JBoss AS7 freezes at startup when launching in debug mode from Eclipse.

    benze
      1. Hi,

       

      I've just moved to JBoss7 for development and am having a lot of difficulty getting this to run in Eclipse Indigo properly.  I'm trying to debug a web service, so I am using the standalone-preview.xml configuration file.  When I launch from command line, it works fine, but from Eclipse, for some strange reason, JBoss just freezes.  I have JBoss AS Tools 3.3.0 M5 installed and have configured the Server runtime environment properly (or so I think).  If I click on "Start" it completes its launch cycle properly.  However, if I click on "Debug", it freezes with the following stack trace in the Eclipse console window:

       

       

      {code}

      12:40:03,017 INFO  [org.jboss.modules] JBoss Modules version 1.0.2.GA

      12:40:03,454 INFO  [org.jboss.msc] JBoss MSC version 1.0.1.GA

      12:40:03,563 INFO  [org.jboss.as] JBoss AS 7.0.2.Final "Arc" starting

      12:40:05,368 WARN  [org.jboss.as] No security realm defined for native management service, all access will be unrestricted.

      12:40:05,382 INFO  [org.jboss.as] creating http management service using network interface (management) port (9990)

      12:40:05,385 WARN  [org.jboss.as] No security realm defined for http management service, all access will be unrestricted.

      12:40:05,405 INFO  [org.jboss.as.logging] Removing bootstrap log handlers

      12:40:05,443 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)

      12:40:05,478 INFO  [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.

      12:40:05,544 INFO  [org.jboss.as.jacorb] (Controller Boot Thread) Activating JacORB Subsystem

      12:40:05,631 INFO  [org.jboss.as.naming] (Controller Boot Thread) JBAS011800: Activating Naming Subsystem

      12:40:05,647 INFO  [org.jboss.as.naming] (MSC service thread 1-5) JBAS011802: Starting Naming Service

      12:40:05,657 INFO  [org.jboss.as.osgi] (Controller Boot Thread) JBAS011910: Activating OSGi Subsystem

      12:40:05,692 INFO  [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem

      12:40:05,699 INFO  [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 3.2.0.Beta2

      12:40:05,730 INFO  [org.xnio] (MSC service thread 1-2) XNIO Version 3.0.0.Beta3

      12:40:05,753 INFO  [org.xnio.nio] (MSC service thread 1-2) XNIO NIO Implementation Version 3.0.0.Beta3

      12:40:06,253 INFO  [org.jboss.as.webservices] (Controller Boot Thread) Activating WebServices Extension

      {code}

       

      At this point, it just hangs and does nothing else.  The Servers view indicates that it is "Starting", but never gets to the "Started" state.  If I try to stop it from within Eclipse, then I get an error message that "Server JBoss 7.0 Runtime Server failed to stop.", and I have to kill the process by hand.

       

      I checked the boot.log or server.log files for any additional hints, but don't see anything else there either.

       

      Can anyone help?  Is there something wrong with the standalone-preview.xml configuration file?  I'm running on Win 7x64.

       

      I just tried switching my JRE from an IBM JRE shipped with WebSphere to the standard Oracle JRE and it will progress further with Oracle's JRE, but still doesn't complete it's launch.  Can anyone explain with the IBM jre would cause it to freeze when launching from Eclipse?  Like I said, it runs fine if I launch from command line.


      Thanks,


      Eric

        • 1. Re: JBoss AS7 freezes at startup when launching in debug mode from Eclipse.
          ozizka

          Attach a thread dump.

          And try launching AS with plain JVM debug options and try attaching Eclipse to it manually. Does that work?

           

          IIRC it goes like

          {code}

          export JAVA_OPTS="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

          bin/standalone.sh

          {code}

          • 2. Re: JBoss AS7 freezes at startup when launching in debug mode from Eclipse.
            benze

            Ondrej Zizka wrote:

             

            Attach a thread dump.

            And try launching AS with plain JVM debug options and try attaching Eclipse to it manually. Does that work?

             

             

            Yes - if I launch it from command line with JPDA and attach using Eclipse, then it works fine.  However, I cannot seem to launch in debug mode from within Eclipse.

             

            Can you please elaborate on how to generate the thread dump?  If I look in the Debug view in Eclipse, I see the threads all listed as "<not responding>":

             

             

            {code} JBoss 7.1 Runtime Server [JBoss Application Server Startup Configuration]     



            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>


            <not responding>

                 org.jboss.modules.Main at localhost:60975                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           C:\servers\WebSphere\AppServer_32bit\java\jre\bin\javaw.exe (Feb 2, 2012 10:16:20 AM)     {code}

             

            I have tried updating to AS7.1.0.CR1b and am have defined a new 7.1 Runtime Environment within Eclipse, but with very similar results (there are even fewer lines output in the console log).  If I try to launch regular (non-debug) it gets further, but never finishes "Starting JBoss 7.1 Runtime Server".  The progress bar never stops.  Additionally the status in the Server view always remains "[Starting, Syncrhonized]" and never changes state to started.

             

            Thanks,


            Eric

            • 3. Re: JBoss AS7 freezes at startup when launching in debug mode from Eclipse.
              rshan

              I'm having the exact same issue.

              • 4. Re: JBoss AS7 freezes at startup when launching in debug mode from Eclipse.
                odavido

                Eric B schrieb:

                 

                Can you please elaborate on how to generate the thread dump?  If I look in the Debug view in Eclipse, I see the threads all listed as "<not responding>":

                 

                 

                 

                on Windows:

                jstack -l <pid>

                 

                on Unix:

                ps -aef | grep -i java | grep -v grep | awk '{print $2}' | xargs jstack -l

                 

                David

                • 5. Re: JBoss AS7 freezes at startup when launching in debug mode from Eclipse.
                  jaikiran

                  Moved to JBoss Tools forum.

                  • 6. Re: JBoss AS7 freezes at startup when launching in debug mode from Eclipse.
                    maxandersen

                    does it fail also on AS7.0?

                     

                    I haven't noticed such freezes while running both 7.1 or 7.0 on linux and osx so wondering if there is some windows specific things.

                     

                    We don't really do anything magical/weird/different in this area so a bit surprised seeing it happen.

                     

                    And yes, getting a stacktrace via jstack would be great.

                     

                    If the short info above is not enough take a look at https://community.jboss.org/wiki/TipsForReportingErrorsAgainstAnEclipsePlugin which outlines it in a bit more detail.  Thanks.

                    • 7. Re: JBoss AS7 freezes at startup when launching in debug mode from Eclipse.
                      jbrow

                      In 7.1.0.Final, I have the same problem, but the "server started" line actually gets printed, but the server never gets to the started state.  There is, apparently, a deadlock between two threads:

                       

                      2012-02-28 13:03:32

                      Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.4-b02-402 mixed mode):

                       

                      [snip...]

                       

                       

                       

                      Found one Java-level deadlock:

                      =============================

                      "Remoting "jim-brownfields-macbook-pro:MANAGEMENT" task-1":

                        waiting to lock monitor 7fd5238be3f0 (object 7d56970f8, a org.jboss.remoting3.remote.InboundMessage),

                        which is held by "Remoting "jim-brownfields-macbook-pro:MANAGEMENT" read-1"

                      "Remoting "jim-brownfields-macbook-pro:MANAGEMENT" read-1":

                        waiting to lock monitor 7fd52a103e90 (object 7d5697118, a org.xnio.streams.BufferPipeInputStream),

                        which is held by "Remoting "jim-brownfields-macbook-pro:MANAGEMENT" task-1"

                       

                       

                      Java stack information for the threads listed above:

                      ===================================================

                      "Remoting "jim-brownfields-macbook-pro:MANAGEMENT" task-1":

                                at org.jboss.remoting3.remote.InboundMessage.openInboundWindow(InboundMessage.java:128)

                                - waiting to lock <7d56970f8> (a org.jboss.remoting3.remote.InboundMessage)

                                at org.jboss.remoting3.remote.InboundMessage$2.acknowledge(InboundMessage.java:63)

                                at org.xnio.streams.BufferPipeInputStream.read(BufferPipeInputStream.java:195)

                                - locked <7d5697118> (a org.xnio.streams.BufferPipeInputStream)

                                at org.jboss.remoting3.remote.InboundMessage$3.read(InboundMessage.java:86)

                                at java.io.FilterInputStream.read(FilterInputStream.java:116)

                                at java.io.FilterInputStream.read(FilterInputStream.java:90)

                                at org.jboss.marshalling.SimpleDataInput.readByte(SimpleDataInput.java:213)

                                at org.jboss.as.protocol.mgmt.ProtocolUtils.expectHeader(ProtocolUtils.java:84)

                                at org.jboss.as.protocol.mgmt.ManagementProtocolHeader.parse(ManagementProtocolHeader.java:110)

                                at org.jboss.as.protocol.mgmt.ManagementChannelReceiver.handleMessage(ManagementChannelReceiver.java:67)

                                at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:435)

                                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:680)

                      "Remoting "jim-brownfields-macbook-pro:MANAGEMENT" read-1":

                                at org.xnio.streams.BufferPipeInputStream.pushEof(BufferPipeInputStream.java:112)

                                - waiting to lock <7d5697118> (a org.xnio.streams.BufferPipeInputStream)

                                at org.jboss.remoting3.remote.InboundMessage.cancel(InboundMessage.java:186)

                                - locked <7d56970f8> (a org.jboss.remoting3.remote.InboundMessage)

                                at org.jboss.remoting3.remote.RemoteConnectionChannel.handleMessageData(RemoteConnectionChannel.java:424)

                                at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:234)

                                at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:45)

                                at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

                                at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)

                                at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)

                                at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

                                at org.xnio.nio.NioHandle.run(NioHandle.java:90)

                                at org.xnio.nio.WorkerThread.run(WorkerThread.java:184)

                       

                       

                      Found 1 deadlock.

                       

                       

                      The full thread dump is attached.

                      • 8. Re: JBoss AS7 freezes at startup when launching in debug mode from Eclipse.
                        maxandersen

                        I'm not 100% sure but regarding the deadlocks we might have found a similar issue and trying to fix by upgrading to more recent JBoss AS 7.1 libraries.

                         

                        Youc can follow https://issues.jboss.org/browse/JBIDE-11199 to see when that will be available.