|
From: Scott B. <sco...@ru...> - 2005-02-23 05:05:37
|
Just in case any one else is looking at the example Michael provided,
not only is JmxMBeanAdapter renamed to MBeanExporter, the
MBeanServerFactoryBean is located under support not factory (found that
out the hard way ;-))
Michael, Thomas or Rob. Have you guys seen this error in relation to
the JMX support?:
Feb 23, 2005 12:01:07 AM GenericConnectorServer ClientCreation.run
WARNING: Failed to open connection: java.io.StreamCorruptedException:
invalid st
ream header
java.io.StreamCorruptedException: invalid stream header
at
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737
)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:253)
at
com.sun.jmx.remote.socket.SocketConnection$ObjectInputStreamWithLoade
r.<init>(SocketConnection.java:354)
at
com.sun.jmx.remote.socket.SocketConnection.readMessage(SocketConnecti
on.java:204)
at
com.sun.jmx.remote.opt.security.AdminServer.connectionOpen(AdminServe
r.java:76)
at
com.sun.jmx.remote.generic.ServerSynchroMessageConnectionImpl.connect
(ServerSynchroMessageConnectionImpl.java:51)
at
javax.management.remote.generic.GenericConnectorServer$ClientCreation
.run(GenericConnectorServer.java:383)
at
com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(Thread
Service.java:208)
at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)
I got this on Tomcat 5.0.27 and 5.0.30-beta. I tried to connect using
jconsole in JDK 5 and connecting to a remote server of localhost:9876 (I
also tried on port 10,000)
Thanks
Scott Battaglia
Application Developer, Architecture and Engineering Team
Enterprise Systems and Services, Rutgers University
v: 732.445.0097 | f: 732.445.5493 | sco...@ru...
Michael Schuerig wrote:
>On Tuesday 22 February 2005 21:26, Scott Battaglia wrote:
>
>
>
>>Okay, I'll look for them after the 1.1.5 release then! In the mean
>>time are any of the test cases a good kind of guide to follow? I'm
>>not too familar with JMX so I'm learning JMX and trying to figure out
>>the Spring support at the same time (probably not a good
>>combination).
>>
>>
>
>If all you want to do is expose a Spring bean as an MBean it's actually
>pretty easy and doesn't require any code.
>
>Create an MBeanServer registered as a bean
>
> <bean id="mbeanserver"
> class="org.springframework.jmx.factory.MBeanServerFactoryBean">
> <property name="defaultDomain"><value>MyDomain</value></property>
> </bean>
>
>Wrap an MBean adapter around my repositorymanager bean (not shown),
>which is a completely ordinary java object. In this case, public
>methods are exposed as attributes/operations. Alternatively, metadata
>can be used.
>
> <bean id="mbeanadapter"
> class="org.springframework.jmx.JmxMBeanAdapter">
> <property name="server"><ref local="mbeanserver"/></property>
> <property name="beans">
> <map>
> <entry key="MyDomain:id=Repository">
> <ref bean="repositorymanager"/>
> </entry>
> </map>
> </property>
> </bean>
>
>Create a connector listening, by default, on
>service:jmx:jmxmp://localhost:9876 (this requires
>jmxremote_optional.jar)
>
> <bean id="jmxconnector"
> class="org.springframework.jmx.support.ConnectorServerFactoryBean">
> <property name="server">
> <ref local="mbeanserver" />
> </property>
> <!-- This is the default URL anyway -->
> <property name="serviceUrl">
> <value>service:jmx:jmxmp://localhost:9876</value>
> </property>
> <property name="threaded">
> <value>true</value>
> </property>
> <!-- Ensure the connector thread doesn't keep the
> servlet container running -->
> <property name="daemon">
> <value>true</value>
> </property>
> </bean>
>
>
>HTH,
>Michael
>
>
>
|