[QFJ-713] On JDK 7 unexpectedly find a registerd MBean for the ObjectName("org.quickfixj:type=Connector,role=Acceptor,*") by the camel-quickfix component of Apache Camel Created: 05/Nov/12  Updated: 19/Nov/12  Resolved: 19/Nov/12

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.5.2
Fix Version/s: None

Type: Bug Priority: Default
Reporter: Babak Vahdat Assignee: Christoph John
Resolution: Not a bug Votes: 0
Labels: jmx


 Description   

Using QuickFixJ version 1.5.2-bd by camel-quickfix we're observing some odd test failures on JDK 7 profile of Apache Camel however the behaviour is nondeterministic as we see the failed tests only from time to time where all the tests of QuickfixjEngineTest do fail because of the same assert, but as already said only on the JDK 7 and just from time to time. Also we cann't reproduce the issue locally. As you see on the trunk currently we've disabled the assert on JDK7.

The stacktrace of the failed assert looks as the following:

java.lang.AssertionError: QFJ mbean should not have been registered
	at org.junit.Assert.fail(Assert.java:93)
	at org.junit.Assert.assertTrue(Assert.java:43)
	at org.apache.camel.component.quickfixj.QuickfixjEngineTest.assertDefaultConfiguration(QuickfixjEngineTest.java:569)
	at org.apache.camel.component.quickfixj.QuickfixjEngineTest.defaultAcceptor(QuickfixjEngineTest.java:161)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:119)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:101)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
	at $Proxy0.invoke(Unknown Source)
	at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
	at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

Which corresponds to this revision of QuickfixjEngineTest.

Currently we've disabled this assert as you can see by the revision history of this class.

Please also note that QuickfixjEngine does properly register/unregister the MBean, see it's doStart & doStop methods. This component's documentation is here. Any hint or idea would be much appreciated. Please let us know if there's any more details you may need.



 Comments   
Comment by Babak Vahdat [ 05/Nov/12 ]

For more details also see https://issues.apache.org/jira/browse/CAMEL-5751

Comment by Christoph John [ 05/Nov/12 ]

Just out of curiosity (I'm pretty sure it does not solve the problem since it would be too obvious ):
Why don't you unregister the MBean for acceptors in the same way as you do for initiators?

Comment by Babak Vahdat [ 05/Nov/12 ]

Ah thanks, yeah indeed it was too obvious to be the cause of the problem and I must have been blind not to see it. Indeed I overlooked this as I committed the fix for https://issues.apache.org/jira/browse/CAMEL-5686
Anyway I've applied a patch into the trunk and reenabled the test again on JDK 7 as well, so let's see how the things will go. Already keeping my fingers crossed!

Comment by Christoph John [ 10/Nov/12 ]

And you say that the same tests always passed on JDK6? Although the beans were not correctly deregistered?

Comment by Babak Vahdat [ 10/Nov/12 ]

Exactly! And this was exactly what baffling me. The same tests never failed on JDK 6.

Comment by Babak Vahdat [ 11/Nov/12 ]

There has been no single test failure on the CI-Server since the fix, following the last run from yesterday:

https://builds.apache.org/job/Camel.trunk.fulltest.java7/356/org.apache.camel$camel-quickfix/testReport/org.apache.camel.component.quickfixj/QuickfixjEngineTest/

Still keeping my fingers crossed

Comment by Christoph John [ 12/Nov/12 ]

Sounds good. I think we should define a reasonable time after which this ticket can be closed.

Comment by Babak Vahdat [ 19/Nov/12 ]

O.K. I think it's time to close this ticket as the issue has not popped up anymore. @Christoph would you please close this ticket as apparently I don't have enough JIRA permission to do that. At least I don't see any "Resolve Issue" button.

Once again thanks for your help.

Generated at Fri May 03 14:17:45 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.