在我的 spring + tomcat 解决方案中,我遇到了 jmxmp 连接问题。
我在 tomcat 中启用了 jmx + 添加了 jmxremote_optional.jar
这是 manager.log
信息:JMXProxy:获取属性 java.lang 时出错:type=MemoryPool,name=Code Cache CollectionUsageThreshold
javax.management.RuntimeMBeanException:java.lang.UnsupportedOperationException:CollectionUsage 阈值不受支持
05.09.2012 16:33:13 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性时出错 java.lang:type=MemoryPool,name=Code Cache CollectionUsageThresholdCount javax.management.RuntimeMBeanException:java.lang.UnsupportedOperationException:不支持 CollectionUsage 阈值
05.09.2012 16:33:13 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性时出错 java.lang:type=MemoryPool,name=Code Cache CollectionUsageThresholdExceeded javax.management.RuntimeMBeanException:java.lang.UnsupportedOperationException:不支持 CollectionUsage 阈值
05.09.2012 16:33:13 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性 Catalina 时出错:type=Resource,resourcetype=Global,class=org.apache.catalina.UserDatabase,name="UserDatabase" modelerType javax.management.AttributeNotFoundException:找不到属性 modelerType
05.09.2012 16:33:13 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性时出错 java.lang:type=MemoryPool,name=PS Eden Space UsageThreshold javax.management.RuntimeMBeanException:java.lang.UnsupportedOperationException : 不支持使用阈值
05.09.2012 16:33:14 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性时出错 java.lang:type=MemoryPool,name=PS Eden Space UsageThresholdCount javax.management.RuntimeMBeanException:java.lang.UnsupportedOperationException : 不支持使用阈值
05.09.2012 16:33:14 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性时出错 java.lang:type=MemoryPool,name=PS Eden Space UsageThresholdExceeded javax.management.RuntimeMBeanException:java.lang.UnsupportedOperationException : 不支持使用阈值
05.09.2012 16:33:14 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性时出错 java.lang:type=MemoryPool,name=PS Survivor Space UsageThreshold javax.management.RuntimeMBeanException:java.lang.UnsupportedOperationException : 不支持使用阈值
05.09.2012 16:33:14 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性时出错 java.lang:type=MemoryPool,name=PS Survivor Space UsageThresholdCount javax.management.RuntimeMBeanException:java.lang.UnsupportedOperationException : 不支持使用阈值
05.09.2012 16:33:14 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性时出错 java.lang:type=MemoryPool,name=PS Survivor Space UsageThresholdExceeded javax.management.RuntimeMBeanException:java.lang.UnsupportedOperationException : 不支持使用阈值
05.09.2012 16:33:50 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性时出错 java.lang:type=MemoryPool,name=Code Cache CollectionUsageThreshold javax.management.RuntimeMBeanException:java.lang.UnsupportedOperationException:不支持 CollectionUsage 阈值 05.09.2012 16:33:50 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性 java.lang:type=MemoryPool 时出错,name=Code Cache CollectionUsageThresholdCount javax.management.RuntimeMBeanException:java .lang.UnsupportedOperationException:CollectionUsage 阈值不受支持 05.09.2012 16:33:50 org.apache.catalina.core.ApplicationContext 日志信息:JMXProxy:获取属性 java.lang:type=MemoryPool,name=Code Cache Collecti 时出错
这是spring con.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
default-lazy-init="true">
<bean id="test" class="test.Test" />
<!-- <bean class="org.springframework.jmx.support.MBeanServerFactoryBean">
<property name="locateExistingServerIfPossible" value="true" />
</bean> -->
<bean id="serverConnector" class="org.springframework.jmx.support.ConnectorServerFactoryBean"/>
<bean class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
<property name="assembler">
<bean class="org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler" >
<property name="managedMethods">
<list>
<value>getVal</value>
<value>setVal</value>
</list>
</property>
</bean>
</property>
<property name="beans">
<map>
<entry key="bean:name=Test" value-ref="test"/>
</map>
</property>
</bean>
</beans>
这是java bean
public class Test {
private String val = "";
public String getVal() {
return val;
}
public void setVal(String v) {
val = v;
}
}