Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1350259

Summary: [GSS](6.4.z) Random ClassCastException for ErrorReportValve at start up
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Aaron Ogburn <aogburn>
Component: WebAssignee: Aaron Ogburn <aogburn>
Status: CLOSED CURRENTRELEASE QA Contact: Radim Hatlapatka <rhatlapa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.9CC: bmaxwell, dosoudil, fgavrilo, jtruhlar, mcada, rmaucher
Target Milestone: CR1   
Target Release: EAP 6.4.10   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/jbossas/jboss-eap/pull/2802
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-17 13:01:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1339868    
Attachments:
Description Flags
01657328.btm
none
standalone-ha.xml none

Description Aaron Ogburn 2016-06-26 20:17:00 UTC
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:

Comment 1 Aaron Ogburn 2016-06-26 20:18:07 UTC
Created attachment 1172650 [details]
01657328.btm

Comment 2 Aaron Ogburn 2016-06-26 20:18:48 UTC
Created attachment 1172651 [details]
standalone-ha.xml

Comment 4 Aaron Ogburn 2016-06-26 22:09:25 UTC
PR: https://github.com/jbossas/jboss-eap/pull/2802

Comment 6 Michael Cada 2016-08-23 08:46:22 UTC
Verified with EAP 6.4.10.CP.CR2

Comment 7 Petr Penicka 2017-01-17 13:01:16 UTC
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.