关于tomcat和jmx的问题 [英] question on tomcat and jmx

查看:98
本文介绍了关于tomcat和jmx的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


MBeanServerFactory.findMBeanServer(null);到底在做什么?
返回所有已注册的MBeanServer的列表?在哪里注册?
我问是因为我有以下问题.
我有一个使用服务包装程序在Tomcat中部署的Java Web应用程序.
我的server.xml中有使用ManagedBeans(启用了弹簧)的自定义连接器实现.
如果我通过服务包装启动应用程序,一切正常.
如果我直接通过Tomcat启动Web应用程序,则部署似乎已中断.
我在日志中看到的只是连接器执行


What is the MBeanServerFactory.findMBeanServer(null); exactly doing?
Returns a list of all registered MBeanServers? Registered where?
I am asking because I have the following problem.
I have a java web app deployed in Tomcat using a service wrapper.
I have custom connector implementations in my server.xml that use ManagedBeans (spring enabled).
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.
All I see in the logs is that the connector does a

MBeanServerFactory.findMBeanServer(null);

,然后尝试调用Bean beanServer.invoke(name, operationName, null, null);
结果是InstanceNotFoundException.
如果我不使用服务包装器,似乎没有加载托管bean?我的理解正确吗?关于如何调试此问题的任何输入是 非常欢迎!

and then tries to invoke the bean beanServer.invoke(name, operationName, null, null);
The result is a InstanceNotFoundException.
It seems that the managed beans are not loaded in case I do not use a service wrapper? 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. If you are using JSW, then you cannot use null as JSW forks the VM as a separate process. This is why you see the InstanceNotFoundException.

这篇关于关于tomcat和jmx的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆