JMX远程注册MBean报错The MBean class could not be loaded by the default loader reposit

问题描述

在远程机器上运行一个MBeanServer(如192.168.1.100),spring配置:<!--导出springbean所有的方法和属性不使用赖加载--><beanid="exporter"class="org.springframework.jmx.export.MBeanExporter"lazy-init="false"><!--需要导出为MBean的spring类--><propertyname="beans"><map><entrykey="Managed-Beans:name=appMonitorBean"value-ref="appMonitorBean"/><!--将JDMK定义的HtmlAdaptorServer的bean加入mbeanmap中--><entrykey="Managed-Beans:name=jdmkadapter,port=8099"value-ref="httpJDMKAdaptor"/><entrykey="Managed-Beans:name=mletLoader"value-ref="mletLoader"/></map></property><!--<propertyname="autodetect"value="true"/>--><!--指定export的MBeanserver--><propertyname="server"ref="mbeanServer"/></bean><beanid="appMonitorBean"class="cn.com.victorysoft.jmxmonitor.mbean.AppMonitorBean"></bean><!--配置类加载器--><beanid="mletLoader"class="javax.management.loading.MLet"></bean><beanid="mbeanServer"class="org.springframework.jmx.support.MBeanServerFactoryBean"/><!--定义JDMK的HtmlAdaptorServerbean--><beanid="httpJDMKAdaptor"class="com.sun.jdmk.comm.HtmlAdaptorServer"><propertyname="port"><value>8099</value></property></bean><!--注册端口我使用的是9992--><beanid="registry"class="org.springframework.remoting.rmi.RmiRegistryFactoryBean"destroy-method="destroy"><propertyname="port"value="9992"/></bean><!--配置服务连接connectorviarmi--><beanid="serverConnector"class="org.springframework.jmx.support.ConnectorServerFactoryBean"depends-on="registry"><propertyname="objectName"value="connector:name=rmi"/><propertyname="serviceUrl"value="service:jmx:rmi:///jndi/rmi://192.168.1.100:9992/jmxrmi"/><propertyname="server"ref="mbeanServer"/><!--多线程启动connector,一个线程一个connector--><propertyname="threaded"value="true"/><!--多线程启动connector,threaddaemon--><propertyname="daemon"value="true"/></bean>启动192.168.1.100的服务,然后在192.168.1.110机器上远程向192.168.1.100服务器的MBeanServer注册MBean(HelloWorld.java):JMXServiceURLjmxUrl=newJMXServiceURL("service:jmx:rmi:///jndi/rmi://192.168.1.100:9992/jmxrmi");JMXConnectorconnector=JMXConnectorFactory.connect(jmxUrl);MBeanServerConnectionmBeanServerconnection=connector.getMBeanServerConnection();//在远程服务器上注册MBeanmBeanServerconnection.createMBean(HelloWorld.class.getName(),newObjectName("Managed-Beans:name=HelloWorldBean"));HelloWorld实现接口HelloWorldMBean,运行192.168.1.110机器上的MBean注册代码后报异常:Exceptioninthread"main"javax.management.ReflectionException:TheMBeanclasscouldnotbeloadedbythedefaultloaderrepositoryatcom.sun.jmx.mbeanserver.MBeanInstantiator.findClassWithDefaultLoaderRepository(MBeanInstantiator.java:71)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:259)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:199)atcom.sun.jmx.mbeanserver.JmxMBeanServer.createMBean(JmxMBeanServer.java:286)atjavax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1382)atjavax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)atjavax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)atjavax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)atjavax.management.remote.rmi.RMIConnectionImpl.createMBean(RMIConnectionImpl.java:222)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atsun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)atsun.rmi.transport.Transport$1.run(Transport.java:159)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.Transport.serviceCall(Transport.java:155)atsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)atsun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)atsun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)atjava.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)atjava.lang.Thread.run(Thread.java:662)atsun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)atsun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)atsun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)atcom.sun.jmx.remote.internal.PRef.invoke(UnknownSource)atjavax.management.remote.rmi.RMIConnectionImpl_Stub.createMBean(UnknownSource)atjavax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.createMBean(RMIConnector.java:627)atcn.com.victorysoft.jmxmonitor.mbean.TestRMI.main(TestRMI.java:84)Causedby:java.lang.ClassNotFoundException:cn.com.victorysoft.jmxmonitor.mbean.HelloWorldatcom.sun.jmx.mbeanserver.ClassLoaderRepositorySupport.loadClass(ClassLoaderRepositorySupport.java:211)atcom.sun.jmx.mbeanserver.ClassLoaderRepositorySupport.loadClass(ClassLoaderRepositorySupport.java:131)atcom.sun.jmx.mbeanserver.MBeanInstantiator.findClassWithDefaultLoaderRepository(MBeanInstantiator.java:68)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:259)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:199)atcom.sun.jmx.mbeanserver.JmxMBeanServer.createMBean(JmxMBeanServer.java:286)atjavax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1382)atjavax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)atjavax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)atjavax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)atjavax.management.remote.rmi.RMIConnectionImpl.createMBean(RMIConnectionImpl.java:222)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atsun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)atsun.rmi.transport.Transport$1.run(Transport.java:159)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.Transport.serviceCall(Transport.java:155)atsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)atsun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)atsun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)atjava.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)atjava.lang.Thread.run(Thread.java:662)请各位大侠解惑,问题出在什么地方?小弟不胜感激

解决方案

解决方案二:
顶起来,大牛们都现身吧,阿门
解决方案三:
在线等~~~~~
解决方案四:
人呢,有懂了大侠给解答下啊

时间: 2024-10-03 23:51:57

JMX远程注册MBean报错The MBean class could not be loaded by the default loader reposit的相关文章

java-jcifs访问远程共享文件系统报错

问题描述 jcifs访问远程共享文件系统报错 在使用jcifs访问远程共享文件系统时:java.lang.RuntimeException: Plain text passwords are disabled. 前几天还是可以访问的.现在连接就报这个错,用户名,密码都是对的,可以远程连接进去.这是怎么回事啊 String smbMachine="smb://"+userName+":"+password+"@"+url+"/"

pl/sql developer-PL/SQL Developer 远程连接Oracle 报错无法解析指定的标识符

问题描述 PL/SQL Developer 远程连接Oracle 报错无法解析指定的标识符 环境: 虚拟机中安装CentOS 6.3 CentOS安装Oracle 11gr2 客户机Win7 问题介绍: 已经在CentOS 启动了实例,监听: 开放了1521端口:虚拟机跟客户机网络连通: 使用DBVisualizer可以连接成功目标实例: PL/SQL Dev连接就报错"ORA-12154: TNS:could not resolve the connect identifier specifi

openfire smack4.1.6 注册用户报错

问题描述 openfire smack4.1.6 注册用户报错 org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPPError: conflict - cancel 代码如下: AccountManager am=AccountManager.getInstance(xmpptcpConnection); am.sensitiveOperationOverInsecureConnection(true); am.createA

远程连接MySQL报错ERROR 2003解决办法

问题代码代码 ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.19' (111) ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.19' (111) 这个 原因就是Mysql数据库的默认配置文件my.cnf(linux下)中的bind-address默认为127.0.0.1,所以就算你创建了可以 remote访问的用户,你也不能使用mys

app服务端集成环信curl Api,打印开放注册模式,报错!!!

问题描述 {"error":"organization_application_not_found","timestamp":1448352204719,"duration":0,"exception":"org.apache.usergrid.rest.exceptions.OrganizationApplicationNotFoundException","error_de

远程连接-Navicat连接mysql报错!!

问题描述 Navicat连接mysql报错!! 用Navicat远程连接数据库是报错,,服务也开启了,请问什么原因 解决方案 Navicat/MySQL Front 操作 MySQL 1577 报错 解决方法 解决方案二: 是用root账号连的么.. 解决方案三: 这个问题是mysql断网下连接产生的? 解决方案四: 远程的服务器的mysql服务打开没? 解决方案五: 确定端口是否正确,有没防火墙(本机连接忽略) 解决方案六: 可能是防火墙的问题,用ping 172.16.80.62命令试下能否

swift-ios真机测试报错,求大神指导(SwiftyJSON.framework)

问题描述 ios真机测试报错,求大神指导(SwiftyJSON.framework) 报错返回码: dyld: Library not loaded: @rpath/SwiftyJSON.framework/SwiftyJSON Referenced from: /private/var/mobile/Containers/Bundle/Application/72F46E5B-AED7-49D7-B7CE-8C74C447B16B/BabyStrategy.app/BabyStrategy R

css-Webstorm里如何设置中文字体格式,font-family老是报错。?

问题描述 Webstorm里如何设置中文字体格式,font-family老是报错.? font-family:'宋体': 报错如下: Font property font-family does not have generic default less... (Ctrl+F1) This inspection verifies that the CSS font-family property contains a generic font name as a fallback alterna

关于webService部署在weblogic上运行报错问题?高分求教!

问题描述 最近将一个Tomcat的项目移植到weblogic上运行,发现以前使用的基于JAX-WS框架创建的webService无法运行,我查了很多资料说是内库加载问题,于是我就在项目的WEB-INFO下加入了个weblogic.xml文件.配置如下:<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEweblogic-web-appPUBLIC"-//BEASystems,Inc.//DTDWebA