简体   繁体   English

关于tomcat和jmx的问题

[英]question on tomcat and jmx


What is the MBeanServerFactory.findMBeanServer(null); 什么是MBeanServerFactory.findMBeanServer(null); exactly doing? 到底在干什么?
Returns a list of all registered MBeanServers? 返回所有已注册的MBeanServer的列表? Registered where? 注册哪里?
I am asking because I have the following problem. 我问是因为我有以下问题。
I have a java web app deployed in Tomcat using a service wrapper. 我有一个使用服务包装程序在Tomcat中部署的Java Web应用程序。
I have custom connector implementations in my server.xml that use ManagedBeans (spring enabled). 我的server.xml中有使用ManagedBeans(启用了弹簧)的自定义连接器实现。
If I start the app via the service wrapper all is ok. 如果我通过服务包装启动应用程序,一切正常。
If I start the web app through Tomcat directly it seems that the deployment breaks. 如果我直接通过Tomcat启动Web应用程序,则似乎部署中断。
All I see in the logs is that the connector does a 我在日志中看到的只是连接器执行了

MBeanServerFactory.findMBeanServer(null);

and then tries to invoke the bean beanServer.invoke(name, operationName, null, null); 然后尝试调用bean beanServer.invoke(name, operationName, null, null);
The result is a InstanceNotFoundException. 结果是InstanceNotFoundException。
It seems that the managed beans are not loaded in case I do not use a service wrapper? 如果我不使用服务包装器,似乎没有加载托管bean? Is my understanding correct? 我的理解正确吗? Any input on how to debug this issue is highly welcome! 非常欢迎您提供有关如何调试此问题的任何意见!

The javadoc says that when you pass null , it returns the servers registered in the current JVM. javadoc说,当您传递null ,它将返回在当前JVM中注册的服务器。 If you are using JSW, then you cannot use null as JSW forks the VM as a separate process. 如果使用的是JSW,则不能使用null因为JSW将VM作为单独的进程进行分叉。 This is why you see the InstanceNotFoundException . 这就是为什么您看到InstanceNotFoundException

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM