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.
I have seen documentation for Tomcat that mentions the use of the "-security" parameter to be passed when there is a need for tomcat to respect the catalina.policy file. I changed the catalina.properties in the .netbeans/... directory, but that is not respected. Currently there is no way to work around this from a web project. Is it possible to launch tomcat, by default, with this setting enabled ? or otherwise allow for this setting to be specified at the time of debugging ?
You have to change this file in the $nb_user_dir/jakarta-tomcat-5.0.28_base/conf directory. Please try this and let us know whether that works for you. This is definitely also a documentation problem - we should tell users that configuration information from $IDE_INST will not be used and users should modify files under user dir. We used to have files called IDE-README.TXT (one for CATALINA_HOME and one for CATALINA_BASE) which explained how the IDE handles these directories. We should re-add these files to the IDE. I am attaching these files that existed in NB 3.5 - they will definitely need a revision for NB 4.0.
Created attachment 17615 [details] IDE-README for CATALINA_HOME
Created attachment 17616 [details] IDE-README for CATALINA_BASE
Oops. I mentioned catalina.properties instead of catalina.policy. That is the file that the -security parameter honours when running from commandline. And yes, I have looked at the files in the directory you mentioned. But it hasn't worked for me for the past 1 month. I was trying to figure what is not working.
Sorry, my previous comments were not really relevant. Adjusting priority, this is not a P1 bug. P3, but we will try to address it for NB 4.0 final.
Tomcat can be now started with the "-security" option and stopped with the "-force" option ("-force" option is available only on UNIX platforms). This options can be enabled in Tomcat properties dialog by selecting "Use Security Manager" and "Force Stop" checkboxes. Commit log: Checking in src/org/netbeans/modules/tomcat5/TomcatManager.java; /cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/TomcatManager.java,v <-- TomcatManager.java new revision: 1.55; previous revision: 1.54 done Processing log script arguments... More commits to come... Checking in src/org/netbeans/modules/tomcat5/ide/StartTomcat.java; /cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/ide/StartTomcat.java,v <-- StartTomcat.java new revision: 1.61; previous revision: 1.60 done Processing log script arguments... More commits to come... Checking in src/org/netbeans/modules/tomcat5/nodes/Bundle.properties; /cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/nodes/Bundle.properties,v <-- Bundle.properties new revision: 1.23; previous revision: 1.22 done Checking in src/org/netbeans/modules/tomcat5/nodes/TomcatInstanceNode.java; /cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/nodes/TomcatInstanceNode.java,v <-- TomcatInstanceNode.java new revision: 1.34; previous revision: 1.33 done
Have configured the IDE (build 200409151800) to run an external Tomcat 5.0.28 with the same shared base dir as the internal server. I also enabled the security flag setting from the UI. When i try to debug the web application, i get the message: Error occurred during initialization of VM -Xrun library failed to init: jdwp JDWP unable to access JVMDI Version 1. Maybe you need to start the VM with the -Xdebug option
I also tried the security flag with the bundled tomcat and even that did not work.
I tried the following and security works with these settings. This is without the security flag turned on in the GUI. Edit the catalina.properties in the conf directory and put the following lines at the end of the file: java.security.manager= java.security.policy=${catalina.base}/conf/catalina.policy
In which log did the error message appear? I've tested the security flag on both linux and windows and it worked fine without any error message. Can you please test it with a fresh user dir and with the latest netbeans build? It would be also very helpful to attach content of "bundled tomcat (5.0.28)", "debugger console" and of other relevant tabs from the output window. Thanks
Build 200409211800. jdk 1.4.2_05 Tried with a fresh user directory. Changed the properties to start in security mode. Tried to just start the tomcat server in debug mode using the "start/stop server" dialog. Here is the output from the "Bundled Tomcat (5.0.28)" window. There are no other tabs shown: Using CATALINA_BASE: C:\Documents and Settings\karnanin\.netbeans\4.0beta1\jakarta-tomcat-5.0.28_base Using CATALINA_HOME: C:\netbeans\nb4.0\jakarta-tomcat-5.0.28 Using CATALINA_TMPDIR: C:\Documents and Settings\karnanin\.netbeans\4.0beta1\jakarta-tomcat-5.0.28_base\temp Using JAVA_HOME: C:\j2sdk1.4.2 Using Security Manager Error occurred during initialization of VM -Xrun library failed to init: jdwp JDWP unable to access JVMDI Version 1. Maybe you need to start the VM with the -Xdebug option
This is a windows & jdk1.4 specific Tomcat bug. It can be fixed by modifying the $CATALINA_HOME/bin/catalina.bat startup script like this: - %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% + %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% I've already filed an issue for it in Tomcat's Bugzilla: http://issues.apache.org/bugzilla/show_bug.cgi?id=31362. Removing "fix-in-40" status whiteboard since workaround exists.
Bug in Tomcat should be fixed now. Setting to FIXED.
We should also make sure that the fix gets into 5.0.29