|
From: Scott B. <sco...@ru...> - 2005-02-28 13:06:36
|
I'll just still with MC4J to connect. It seems to work pretty well anyway. Thanks Scott Rob Harrop wrote: > After looking to changing the default protocol I realised it might be > a problem for testing since we need to have a JNDI server or similar > lookup service available to be able to do so. I'll stick with the > JMXMP protocol as the default but you might want to change it in your > application. > > Rob > > Rob Harrop wrote: > >> Scott, >> >> The reason you can't connect with jconsole, I think, is to do with >> the default protocol used - jmxmp, which is not supported. I'm going >> to change this today. >> >> I will add logic to detect a proxy and look for attributes on the >> superclass so that you can use Commons Attributes with a proxy. >> >> Rob >> >> Scott Battaglia wrote: >> >>> Rob, >>> >>> Thanks for the PDF. :-) I got the error to go away by connecting >>> with MC4J (I was trying to use jconsole to connect localhost:9876 >>> but that didn't work). >>> >>> I found an interesting thing (that in hindsight is pretty obvious): >>> you can't expose with Commons Attributes any bean you've proxied. >>> It obviously (again in hindsight) can't find the attributes. >>> >>> Thanks >>> >>> -Scott >>> >>> >>> >>> Rob Harrop wrote: >>> >>>> Scott, >>>> >>>> A lot of the class names and package names changed. I have uploaded >>>> a PDF of the work in progress docs to the Wiki. Be aware that it is >>>> still quite rough, but it should give you a good idea of what is >>>> going on. >>>> >>>> With your error, what protocol are you using to connect to the >>>> MBeanServer? >>>> >>>> Rob >>>> >>>> Scott Battaglia wrote: >>>> >>>>> 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 >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> ------------------------------------------------------- >>>>> SF email is sponsored by - The IT Product Guide >>>>> Read honest & candid reviews on hundreds of IT Products from real >>>>> users. >>>>> Discover which products truly live up to the hype. Start reading now. >>>>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >>>>> _______________________________________________ >>>>> Springframework-developer mailing list >>>>> Spr...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/springframework-developer >>>>> >>>>> >>>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> SF email is sponsored by - The IT Product Guide >>>> Read honest & candid reviews on hundreds of IT Products from real >>>> users. >>>> Discover which products truly live up to the hype. Start reading now. >>>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >>>> _______________________________________________ >>>> Springframework-developer mailing list >>>> Spr...@li... >>>> https://lists.sourceforge.net/lists/listinfo/springframework-developer >>> >>> >>> >>> >>> >>> >>> ------------------------------------------------------- >>> SF email is sponsored by - The IT Product Guide >>> Read honest & candid reviews on hundreds of IT Products from real >>> users. >>> Discover which products truly live up to the hype. Start reading now. >>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >>> _______________________________________________ >>> Springframework-developer mailing list >>> Spr...@li... >>> https://lists.sourceforge.net/lists/listinfo/springframework-developer >>> >>> >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real users. >> Discover which products truly live up to the hype. Start reading now. >> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |