开发者

question on tomcat and jmx

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开发者_StackOverflow 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);

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜