Question about tomcat and jmx


What exactly does MBeanServerFactory.findMBeanServer(null); ?
Returns a list of all registered MBeanServers? Registered where?
I ask because I have the following problem.
I have a Java application deployed to Tomcat using a service wrapper.
I have my own connector implementations in my .xml server that use ManagedBeans (spring enabled).
If I run the application through the service shell, everything is fine.
If I run the web application through Tomcat directly, the deployment seems to break.
All I see in the logs is what the connector does

 MBeanServerFactory.findMBeanServer(null); 

and then tries to call bean beanServer.invoke(name, operationName, null, null);
The result is an InstanceNotFoundException exception.
Managed beans don't seem to load in case I don't use the service shell? Do I understand correctly? Any data on debugging this problem is welcome!

0
source share
1 answer

javadoc says that when passing null it returns the servers registered in the current JVM. If you use JSW, you cannot use null , since JSW creates the virtual machine as a separate process. This is why you see an InstanceNotFoundException .

+1
source

Source: https://habr.com/ru/post/886532/


All Articles