Bug 1114479

Summary: Sever level MBean hasn't been initialized yet when a web app starts up, causing javax.management.InstanceNotFoundException
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Osamu Nagano <onagano>
Component: WebAssignee: Rémy Maucherat <rmaucher>
Status: CLOSED CURRENTRELEASE QA Contact: Radim Hatlapatka <rhatlapa>
Severity: unspecified Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.1.1CC: mvelas
Target Milestone: ER10   
Target Release: EAP 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-31 11:15:05 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:
Attachments:
Description Flags
test_valve.jar and TestWAR.war and config files none

Description Osamu Nagano 2014-06-30 07:41:16 UTC
Created attachment 913277 [details]
test_valve.jar and TestWAR.war and config files

Description of problem:
With "-Dorg.apache.tomcat.util.ENABLE_MODELER=true", server level MBeans like a global valve become available. Those should be visible from start phase of a web app, though sometimes those are missing and javax.management.InstanceNotFoundException is thrown.


How reproducible:
This sporadically happens due to the parallel nature of WildFly start up. It is reproducible by using a debugger (Eclipse is better than JDB, because JDB stops all threads).


Steps to Reproduce:
Follow the steps described in WFLY-3557.  Here is the summary of it.
1. Unzip attached sample.zip onto $JBOSS_HOME of EAP 6.1.1.
2. Set break point at org.apache.catalina.core.ContainerBase:1203.
3. Start the server.


Actual results:
~~~
09:46:06,302 INFO  [stdout] (ServerService Thread Pool -- 53) --- TestValve2 : start 
09:46:06,303 INFO  [stdout] (ServerService Thread Pool -- 53) --- TestValve2 : getGlobalConfiguration
09:46:06,304 INFO  [stdout] (ServerService Thread Pool -- 53) --- TestValve2 : getGlobalConfiguration error
09:46:06,306 ERROR [stderr] (ServerService Thread Pool -- 53) javax.management.InstanceNotFoundException: jboss.web:name=TestValve,type=Valve
09:46:06,306 ERROR [stderr] (ServerService Thread Pool -- 53) 	at org.jboss.as.jmx.PluggableMBeanServerImpl.findDelegate(PluggableMBeanServerImpl.java:94)
09:46:06,307 ERROR [stderr] (ServerService Thread Pool -- 53) 	at org.jboss.as.jmx.PluggableMBeanServerImpl.getAttribute(PluggableMBeanServerImpl.java:171)
09:46:06,307 ERROR [stderr] (ServerService Thread Pool -- 53) 	at test.valve.TestValve2.getGlobalConfiguration(TestValve2.java:100)
09:46:06,307 ERROR [stderr] (ServerService Thread Pool -- 53) 	at test.valve.TestValve2.start(TestValve2.java:68)
09:46:06,308 ERROR [stderr] (ServerService Thread Pool -- 53) 	at org.apache.catalina.core.StandardPipeline.start(StandardPipeline.java:223)
09:46:06,309 ERROR [stderr] (ServerService Thread Pool -- 53) 	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3713)
09:46:06,310 ERROR [stderr] (ServerService Thread Pool -- 53) 	at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156)
09:46:06,310 ERROR [stderr] (ServerService Thread Pool -- 53) 	at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)
09:46:06,311 ERROR [stderr] (ServerService Thread Pool -- 53) 	at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
09:46:06,311 ERROR [stderr] (ServerService Thread Pool -- 53) 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
09:46:06,311 ERROR [stderr] (ServerService Thread Pool -- 53) 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
09:46:06,312 ERROR [stderr] (ServerService Thread Pool -- 53) 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
09:46:06,312 ERROR [stderr] (ServerService Thread Pool -- 53) 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
09:46:06,312 ERROR [stderr] (ServerService Thread Pool -- 53) 	at java.lang.Thread.run(Thread.java:744)
09:46:06,313 ERROR [stderr] (ServerService Thread Pool -- 53) 	at org.jboss.threads.JBossThread.run(JBossThread.java:122)
~~~


Expected results:
MBean "jboss.web:name=TestValve,type=Valve" should be available in start() method of TestValve2.


Additional info:
WildFly 8+ replaced the web server with Undertow so the reproducing steps are not applicable to the recent upstream versions.

Comment 1 Martin Velas 2014-07-31 11:15:05 UTC
This issue reported against older version, cannot be reproduced against latest 6.3.0.ER10 bits, which means it was fixed earlier. Therefore, we are closing this bug. Thank you for reporting this issue.