Description of problem: When starting with -Dorg.apache.catalina.connector.WAIT_FOR_BEFORE_START set, an exception like the following can be seen randomly at start up if the WebVirtualHostService.start and WebConnectorService.start are firing at the same time. ERROR [org.apache.catalina.core] (MSC service thread 1-1) JBWEB001085: Failed loding specified error report valve class: org.apache.catalina.valves.ErrorReportValve: java.lang.ClassCastException: org.apache.catalina.valves.ErrorReportValve cannot be cast to org.apache.catalina.Container at org.jboss.as.web.WebConnectorService$2.containerEvent(WebConnectorService.java:344) [jboss-as-web-7.5.9.Final-redhat-SNAPSHOT.jar:7.5.9.Final-redhat-SNAPSHOT] at org.apache.catalina.core.ContainerBase.fireContainerEvent(ContainerBase.java:1345) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1] at org.apache.catalina.core.ContainerBase.addValve(ContainerBase.java:1204) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1] at org.apache.catalina.core.StandardHost.start(StandardHost.java:462) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:803) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1] at org.apache.catalina.core.StandardEngine.addChild(StandardEngine.java:217) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1] at org.jboss.as.web.WebServerService.addHost(WebServerService.java:167) [jboss-as-web-7.5.9.Final-redhat-SNAPSHOT.jar:7.5.9.Final-redhat-SNAPSHOT] at org.jboss.as.web.WebVirtualHostService.start(WebVirtualHostService.java:98) [jboss-as-web-7.5.9.Final-redhat-SNAPSHOT.jar:7.5.9.Final-redhat-SNAPSHOT] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.6.Final-redhat-1.jar:1.1.6.Final-redhat-1] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.6.Final-redhat-1.jar:1.1.6.Final-redhat-1] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_75] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_75] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75] Version-Release number of selected component (if applicable): How reproducible: Somewhat Steps to Reproduce: 1. Enable byteman rule in JVM options: -javaagent:/path/to/$BYTEMAN_HOME/lib/byteman.jar=script:/path/to/$BYTEMAN_HOME/01657328.btm,sys:/path/to/$BYTEMAN_HOME/lib/byteman.jar 2. Start up with the attached standalone xml and org.apache.catalina.connector.WAIT_FOR_BEFORE_START set: ./standalone.sh -c standalone-ha.xml -Dorg.apache.catalina.connector.WAIT_FOR_BEFORE_START=/foobar 3. Check for the exception. Seeing this right before the forced StandardHost sleep is an indication that the problem start up ordering was hit: 16:07:50,528 INFO [stdout] (MSC service thread 1-1) addContainerListener: StandardEngine[jboss.web].StandardHost[default-host] org.jboss.as.web.WebConnectorService$2@2749da2b Actual results: ClassCastException may occur Expected results: ClassCastException does not occur Additional info:
Created attachment 1172650 [details] 01657328.btm
Created attachment 1172651 [details] standalone-ha.xml
PR: https://github.com/jbossas/jboss-eap/pull/2802
Verified with EAP 6.4.10.CP.CR2
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.