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.

Bug 48992 - No support for starting Tomcat with security flag enabled
Summary: No support for starting Tomcat with security flag enabled
Status: CLOSED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Sherold Dev
URL: http://issues.apache.org/bugzilla/sho...
Keywords: TOMCAT
Depends on:
Blocks:
 
Reported: 2004-09-14 11:41 UTC by navneet
Modified: 2006-06-03 23:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE-README for CATALINA_HOME (2.64 KB, text/plain)
2004-09-14 13:20 UTC, Petr Jiricka
Details
IDE-README for CATALINA_BASE (2.53 KB, text/plain)
2004-09-14 13:22 UTC, Petr Jiricka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description navneet 2004-09-14 11:41:01 UTC
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 ?
Comment 1 Petr Jiricka 2004-09-14 13:19:12 UTC
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.
Comment 2 Petr Jiricka 2004-09-14 13:20:31 UTC
Created attachment 17615 [details]
IDE-README for CATALINA_HOME
Comment 3 Petr Jiricka 2004-09-14 13:22:03 UTC
Created attachment 17616 [details]
IDE-README for CATALINA_BASE
Comment 4 navneet 2004-09-14 19:22:18 UTC
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. 

Comment 5 Petr Jiricka 2004-09-15 09:35:47 UTC
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.
Comment 6 Sherold Dev 2004-09-15 14:19:02 UTC
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 
Comment 7 navneet 2004-09-17 11:52:38 UTC
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
Comment 8 navneet 2004-09-17 11:57:05 UTC
I also tried the security flag with the bundled tomcat and even that
did not work.
Comment 9 navneet 2004-09-17 11:57:57 UTC
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
Comment 10 Sherold Dev 2004-09-17 14:37:26 UTC
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
Comment 11 navneet 2004-09-22 09:07:22 UTC
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
Comment 12 Sherold Dev 2004-09-22 14:34:32 UTC
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.
Comment 13 Sherold Dev 2004-09-24 08:42:41 UTC
Bug in Tomcat should be fixed now. Setting to FIXED.
Comment 14 Martin Grebac 2004-09-24 08:49:32 UTC
We should also make sure that the fix gets into 5.0.29