关于The MBean class could not be loaded by the default loader repository的解决方法
2007-03-05 22:07
1261 查看
最近项目要用到JMX,开发环境tomcat 5.0.28+jdk 1.5+jmx1.2,采用RMI方式链接,研究过程中出现了The MBean class could not be loaded by the default loader repository这个Exception,通过在网上查找来到了http://archives.java.sun.com/cgi-bin/wa?A2=ind0002&L=jmx-forum&P=3052,这里有对此问题解决方法的详细介绍,如下文:
To avoid the problem you are having, you should remove the JMX classes from the
jre/lib/ext/ directory of your JDK, and put them instead in another directory
that has no special meaning for the JDK.
This problem comes from a bug in the JMX Early Access when used as Java
Installed Extensions, which is what you did. It will be fixed for the final
release of the JMX RI.
What happened here is that, as you had jmxri.jar in the jre/lib/ext/ directory,
a specific Extension Class Loader was used to load the MBeanServer class when
the agent was created
(see http://java.sun.com/docs/books/tutorial/ext/basics/load.html for more info
on extension class loading).
Then the MBeanServer attempted to load the MBean classes using this same
Extension Class Loader, which would not work because the Extension Class Loader
does not load classes from the classpath.
大概意思就是这个错误是因为JMX本身bug导致的,删除jre/lib/ext下的关于JMX的jar包,在classpath中重新指定jar包的位置就能解决.但是这个是对于早期的JMX而言的,我在自己的机器上查找发现JDK 1.4和1.5的相应目录下都没有关于JMX的jar包.可见JMX本身的bug已经被修复了.那是那方面出的问题呢?
仔细从几个错误中发现,产生此异常的时not found 的MBean都是自己写的,于时将自己写的MBean进行打包,然后进行各种尝试,最后看到了上文的帖子,抱着试一试的想法放入ext下,至此问题解决.
我的这个方法虽然能解决问题,但是我总觉得应该会有更好的方法,不知道你遇到这种情况时是如何解决的呢?
相关文章推荐
- 关于在xcode中使用Versions时,比较文件出现The File Merge application could not be located. 解决方法
- 关于在xcode中使用Versions时,比较文件出现The File Merge application could not be located. 解决方法
- An EJB Exception:The user-provided class "XXXX" needed by the EnterpriseBean could not be found or loaded.
- 解决IIS出现The specified module could not be found的方法
- The version of CKEditor could not be detected.解决方法
- 菜鸟解决方法 A class file was not written. The project may be inconsisten
- The following classes could not be instantiated: - android.support.v7.widget.Toolbar 解决方法
- The message received from the server could not be parsed 错误解决方法
- IIS错误解决方法:The specified module could not be found、访问 IIS 元数据库失败
- 关于requires 'org.eclipse.gef 0.0.0' but it could not be found的解决方法
- ADS错误之the session file 'C:\user\username\default-1-2-0-0.ses' could not be loaded
- Exchange 2013 DAG报错“The fully qualified domain name for node “DAG” could notbefound”解决方法
- This platform could not be created because a solution platform of the same name already exists解决方法
- jar包无法运行——could not find the main class...(java -jar *.jar可以运行,jar包不可以打开的解决方法)
- The following control could not be licensed: TXTextControl.TextControl解决方法
- 2012-11-02 10:55 ADS错误the session file 'C:\user\username\default-1-2-0-0.ses' could not be loaded解决办
- Failed to execute request because the App-Domain could not be created. Error: 0×80131902的解决方法
- http:101249 .jsp could not be loaded because the requested class was not found the classpath
- IIS出现The specified module could not be found错误解决方法!
- IIS出现The specified module could not be found的解决方法