This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Separate VM Options for start and stop | ||
---|---|---|---|
Product: | serverplugins | Reporter: | stroudcuster <stroudcuster> |
Component: | Tomcat | Assignee: | Petr Hejl <phejl> |
Status: | NEW --- | ||
Severity: | blocker | CC: | bmaras |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
stroudcuster
2008-08-11 17:43:31 UTC
I encountered the same problem many times before doing the same analysis as you did. When trying to stop (or restart) Tomcat from Netbeans, nothing ever happened : Tomcat did not stop. It was because I passed the following options in the "VM Options" field in Netbeans, to enable JMX : -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9004 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false In this case, Netbeans passes these parameters in the JAVA_OPTS environment variable. It works correctly when you want to start Tomcat. But when you want to stop it, catalina.sh/bat runs another instance of the JVM to tell Tomcat to stop. It uses the same JAVA_OPTS parameters, and thus tries to open a port that is already in use : it fails and Tomcat never stops. If found a similar issue in tomcat itself : https://issues.apache.org/bugzilla/show_bug.cgi?id=36976 The fix is that Tomcat now ignores the CATALINA_OPTS when asked to stop That's why I would propose to display two separate fields in Netbeans configuration : one for JAVA_OPTS and another one for CATALINA_OPTS. It would enable the user to put the JMX parameters in CATALINA_OPTS, so that stop/restart would work in all cases. Should I edit the description of this bug for that? Another workaround is to keep this field empty in Netbeans, and put the parameters in a setenv.sh/bat file in /bin directory of Tomcat : set JAVA_OPTS=%JAVA_OPTS% -server -Xmx1024m set CATALINA_OPTS=%CATALINA_OPTS% -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9004 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false I've struggled with this for months and I'm glad to see someone describe it, finally. (tested on Netbeans 7.3) The suggestion for enhancement from 'bmaras' seems to be the way to go. |