Ryan Zhu
Ryan Zhu

Reputation: 553

how to integrate mx4j httpadaptor into a servlet so that no need to start another server with an ip and port?

I am trying to visit the jmx operations via http interface with mx4j HttpAdaptor. And here is the spring configuration:

<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean" />
<bean id="httpAdaptor" class="mx4j.tools.adaptor.http.HttpAdaptor">
    <property name="processor">
        <ref bean="xsltProcessor" />
    </property>
    <property name="host">
        <value>127.0.0.1</value>
    </property>
    <property name="port" value="9988" />
</bean>
<bean id="xsltProcessor" class="mx4j.tools.adaptor.http.XSLTProcessor" />
<bean class="org.springframework.jmx.export.annotation.AnnotationMBeanExporter"/> 

All my jmx mbeans are annotated by spring jmx annotation.

But as the configuration above,I need to set a new host and a new port for the mx4j HttpAdaptor,but it seems not a good idea as in the production environment, it would be hard to maintain different ip and port on several servers. So can I integrate mx4j HttpAdaptor into a servlet so that no need to open another port ?

PS:I'm using jetty as the web container.

Upvotes: 0

Views: 1149

Answers (1)

Nicholas
Nicholas

Reputation: 16066

The MX4J HttpAdaptor is not really built to integrate into a servlet. Take a look at this question for some alternatives.

Upvotes: 1

Related Questions