[Design of JMX on JBoss (JBoss/JMX)] - Re: XMBean NotSerializationExceptions issue
by yichong_yang_jboss
What I'm trying to do is very simple, which is using twiddle.sh to query some MBean info and their attribute values to reach the same goal as my going to the JBoss JMX console to get all I need.
My understanding is that the fix would bypass the Serializable issue and make me go through to get any attribute value I need. And it seems this is not the case in the most recent versions including 4.2.2 GA.
The following shows what I tried to do here:
1) Get the attribute value for Server Info and I got it as follows:
bash-2.05# ./twiddle.sh -s yyangxp:1099 get jboss.system:type=ServerInfo
HostAddress=192.168.175.45
AvailableProcessors=2
OSArch=sparc
OSVersion=5.9
HostName=camaro
JavaVendor=Sun Microsystems Inc.
JavaVMName=Java HotSpot(TM) Server VM
FreeMemory=68600432
ActiveThreadGroupCount=9
TotalMemory=133103616
JavaVMVersion=1.5.0_08-b03
ActiveThreadCount=117
JavaVMVendor=Sun Microsystems Inc.
OSName=SunOS
MaxMemory=531628032
JavaVersion=1.5.0_08
2) Get the attribute value for ThreadPool info and I failed as follows:
bash-2.05# ./twiddle.sh -s yyangxp:1099 get jboss.system:service=ThreadPool
08:41:37,451 ERROR [Twiddle] Exec failed
java.io.NotSerializableException: org.jboss.util.threadpool.BasicThreadPool
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at java.util.ArrayList.writeObject(ArrayList.java:569)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at java.rmi.MarshalledObject.(MarshalledObject.java:92)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:424)
at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:133)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:331)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:194)
at org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor.invoke(InvokerAdaptorClientInterceptor.java:66)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
at $Proxy1.getAttributes(Unknown Source)
at org.jboss.console.twiddle.command.GetCommand.execute(GetCommand.java:168)
at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:305)
So the real question is "Is there any workaround I can get non serializable MBean attribute values remotely?". I noticed you or someone else posted something at http://jira.jboss.com/jira/browse/JBAS-4323, which seems to be able to resolve the issue I have. But I have no idea how to apply this patch into my JBoss environment to make it work.
Your further advice is very much appreciated!
-Yichong
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138975#4138975
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138975
16 years, 6 months
[Design the new POJO MicroContainer] - PropertyReplaceTC failing in maven
by alesj
Does anyone else get this failure when running test in maven (+ Winz XP):
| -------------------------------------------------------------------------------
| Test set: org.jboss.test.kernel.config.test.PropertyReplaceTestCase
| -------------------------------------------------------------------------------
| Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec <<< FAILURE!
| testAnnotationPropertyReplace(org.jboss.test.kernel.config.test.PropertyReplaceTestCase) Time elapsed: 0.016 sec <<< FAILURE!
| junit.framework.ComparisonFailure: null expected:<test.[PropertyReplaceTestCase].Name> but was:<test.[${test.property.value}].Name>
| at junit.framework.Assert.assertEquals(Assert.java:81)
| at junit.framework.Assert.assertEquals(Assert.java:87)
| at org.jboss.test.kernel.config.test.PropertyReplaceTestCase.testAnnotationPropertyReplace(PropertyReplaceTestCase.java:88)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at junit.framework.TestCase.runTest(TestCase.java:168)
| at junit.framework.TestCase.runBare(TestCase.java:134)
| at junit.framework.TestResult$1.protect(TestResult.java:110)
| at junit.framework.TestResult.runProtected(TestResult.java:128)
| at junit.framework.TestResult.run(TestResult.java:113)
| at junit.framework.TestCase.run(TestCase.java:124)
| at junit.framework.TestSuite.runTest(TestSuite.java:232)
| at junit.framework.TestSuite.run(TestSuite.java:227)
| at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
| at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
| at junit.framework.TestResult.runProtected(TestResult.java:128)
| at junit.extensions.TestSetup.run(TestSetup.java:27)
| at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
| at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
| at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
| at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
|
|
It passes for me in IDE and on my Linux box.
But been getting this for a while now, and I think I already 'complained' about it a while ago, but just cannot find the post anymore.
Any ideas of what can go wrong?
Or is this just another maven cl hick-up?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138966#4138966
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138966
16 years, 6 months