tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harish Kumar K.K." <>
Subject Tomcat with Security manager
Date Thu, 06 Feb 2003 04:57:54 GMT
Hello All

Hope somebody can help me!

I am using Tomcat 4.0.3 on a Red Hat Linux 7.1 system with Apache 1.3.27, and it works fine
if started without the security manager. Recently I had to put up a file upload form on one
of my web sites, and when I deployed the jsp to accept the form data and save the uploaded
file to came up with the error "File cannot be saved". I am using jspSmartUpload
class to handle the multipart form data and to save the file to disk, which can be downloaded

So I read the documentation and figured, the security manager might have to be enabled with
appropriate File IO permissions set for the directory to which I was trying to save the file.

I proceeded to add the required "grant" directive in the catalina.policy file, and when I
started Tomcat with the security manager wouldn't start! I checked catalina.out
and saw that Tomcat is not able to read server.xml. Here is the stacktrace I found in catalina.out

Catalina.start: access denied (
/var/tomcat4/conf/server.xml read) access denied ( /var/tomcat4/conf/server.xml
        at java.lang.SecurityManager.checkPermission(
        at java.lang.SecurityManager.checkRead(
        at org.apache.xerces.readers.DefaultReaderFactory.createReader(
        at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(
        at org.apache.xerces.framework.XMLParser.parseSomeSetup(
        at org.apache.xerces.framework.XMLParser.parse(
        at org.xml.sax.helpers.XMLReaderAdapter.parse(
        at javax.xml.parsers.SAXParser.parse(
        at javax.xml.parsers.SAXParser.parse(
        at org.apache.catalina.util.xml.XmlMapper.readXml(
        at org.apache.catalina.startup.Catalina.start(
        at org.apache.catalina.startup.Catalina.execute(
        at org.apache.catalina.startup.Catalina.process(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.apache.catalina.startup.Bootstrap.main(

Then, I found from the security manager howto on the web site, that if no security manager
is enabled, its just like giving all permissions...I am guessing this means that in that case
the operating system file permission system only will be in effect. So I made the directory
I wanted to save the file into, world writable, just to make sure the OS is not preventing
the save operation. Then started Tomcat without the security manager...still the same result!

Now I am totally confused! What am I doing wrong?
Can anybody help me? Please?

Thanks and Regards
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message