JBoss hangs during startup if application calls System.exit() from initialisation code.

Solution Verified - Updated -

Issue

JBoss is hanging during startup, and trying to shut it down does not work.

In the thread dump, there is:

"ServerService Thread Pool -- 90" prio=10 tid=0x00007f89f0249000 nid=0x1f52 in Object.wait() [0x00007f89b90fa000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000006d67f6080> (a java.lang.Thread)
    at java.lang.Thread.join(Thread.java:1260)
    - locked <0x00000006d67f6080> (a java.lang.Thread)
    at java.lang.Thread.join(Thread.java:1334)
    at java.lang.ApplicationShutdownHooks.runHooks(ApplicationShutdownHooks.java:106)
    at java.lang.ApplicationShutdownHooks$1.run(ApplicationShutdownHooks.java:46)
    at java.lang.Shutdown.runHooks(Shutdown.java:123)
    at java.lang.Shutdown.sequence(Shutdown.java:167)
    at java.lang.Shutdown.exit(Shutdown.java:212)
    - locked <0x00000006d671a8c8> (a java.lang.Class for java.lang.Shutdown)
    at java.lang.Runtime.exit(Runtime.java:109)
    at java.lang.System.exit(System.java:961)
    at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:222)
    at javax.servlet.GenericServlet.init(GenericServlet.java:242)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194)
    - locked <0x0000000713e05dc8> (a org.apache.catalina.core.StandardWrapper)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1100)
    - locked <0x0000000713e05dc8> (a org.apache.catalina.core.StandardWrapper)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3591)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3798)
    - locked <0x0000000713a093c8> (a org.apache.catalina.core.StandardContext)
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156)
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.