0
votes

I'm trying to connect IntelliJ IDEA 12 to a Tomcat 6 server I have running on a remote machine, but I'm encountering an error with reason "javax.management.InstanceNotFoundException: Catalina:type=MBeanFactory".

I'm starting the Tomcat JVM with the following arguments (amongst others):

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=10.10.1.20"

I've created a "Tomcat Server > Remote" run configuration and set the JMX port to 1099 to match the above.

When I try and run that configuration, I get the following output:

Error running <configuration name>
Unable to connect to the 10.10.1.20:1099, reason:
javax.management.InstanceNotFoundException: Catalina:type=MBeanFactory

Does anyone know how I can avoid this error?

1

1 Answers

3
votes

I found the answer whilst writing this question: my server.xml didn't have a ServerLifecycleListener, which - as per the Tomcat documentation - is required to make the MBeans available.

I added the following line to my <Server> element in server.xml:

<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />

IntelliJ now makes the connection successfully.