Make sure you enable permissions for your application,
in your case you should have something like this in your
security file (default is conf/tomcat.security when using -security flag):
grant codeBase "file:${tomcat.home}/webapps/ip" {
permission java.io.FilePermission
"C:\work\tomcat\webapps\ip\WEB-INF\lib\PerlTools.jar", read";
};
if this exception originates from your code. You didn't include complete
stack trace, so I dunno where it started. In a nutshell all
ProtectionDomain's (codebases) should have this permission. In case of
Tomcat this generally means that the permission should be granted to all
jars in ${TOMCAT_HOME}/lib, all files in ${TOMCAT_HOME}/classes and to
directory contatining WEB-INF of your application. BTW if you don't need to
run Tomcat in secure VM, just turn it off.
Regards,
V.
-----Original Message-----
From: Brian Lenz [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 2:09 PM
To: [EMAIL PROTECTED]
Subject: AccessControlException in Tomcat
Hello,
I am running Tomcat 3.3 milestone 4 as an out-of-process servlet container
along with Apache Web Server. When I start up Tomcat, my application
initializes correctly. Additionally, I can successfully make requests to
the application through the web server.
However, before each request is fulfilled, Tomcat throws an
AccessControlException. The exception states that access is denied to one
of the included libraries (jar). The error is a java.io.FilePermission
error. Each time that this particular library is referenced, Tomcat throws
this exception and the application fails to handle the request. I can run
this identical application through Apache JServ and avoid this error, but I
would like to get it up and running in Tomcat as well. Does anyone have any
idea why a file access error might be happening in Tomcat? I've checked all
of the necessary file permissions, and they are all set up correctly. Is it
possible that Tomcat has tried to open the file twice and caused a file read
exception on its own? I have included the stack trace below for reference.
Also, I tried running the application in Tomcat 3.2.2 and ran into the same
problem.
I would appreciate any help anyone can give to me!
Thanks!
Brian
java.security.AccessControlException: access denied (java.io.FilePermission
C:\w
ork\tomcat\webapps\ip\WEB-INF\lib\PerlTools.jar read)' at
java.security.AccessControlException: access denied (java.io.FilePermission
C:\w
ork\tomcat\webapps\ip\WEB-INF\lib\PerlTools.jar read)
at
java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:279)
at
java.security.AccessController.checkPermission(AccessController.java:
405)
at
java.lang.SecurityManager.checkPermission(SecurityManager.java:551)
at java.net.URLClassLoader$4.run(URLClassLoader.java:468)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.getPermissions(URLClassLoader.java:466)
at
java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader
.java:168)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:11
7)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$300(URLClassLoader.java:69)
at
java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java(Compiled
Code))
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java(Compiled
Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at
java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java(Compiled
Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java:257)
...
***********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original
message.
***********************************************************************