Hi David,
Thanks for the suggestion. I have put the attribute tempDir="/temporary" in
the controller element of the struts-config.xml. Even then it does'nt work.
I have this line in struts-config.xml

<controller processorClass="org.apache.struts.action.RequestProcessor"
tempDir="/temporary" nocache="true" />

The exception now is almost the same except for the "\temporary" directory

java.security.AccessControlException: access denied
(java.io.FilePermission\temporary\upload_00000000.tmp delete)
at java.security.AccessControlContext.checkPermission(
AccessControlContext.java:269)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkDelete(SecurityManager.java:982)
at java.io.File.deleteOnExit(File.java:879)
.................................................................................................................................

PLEASE HELP!!!

Thanks.
Zahid.



On 6/22/06, David Friedman <[EMAIL PROTECTED]> wrote:

Zahid,

I don't use that application server but I have a suggestion: change your
temp file download directory.  Your stack trace shows Struts is using the
CommonsMultiPartRequestHandler class and I have read it has ways to change
the temp directory.  The Javadocs on that class list 3 ways that might
help
you change the directory to another directory such as /tmp.  Those ways
are:

A temp dir explicitly defined either using the tempDir servlet init param,
or the tempDir attribute of the <controller>  element in the Struts config
file.

The container-specified temp dir, obtained from the
javax.servlet.context.tempdir servlet context attribute.

The temp dir specified by the java.io.tmpdir system property.

I hope this helps.
-David

-----Original Message-----
From: zahid mohammed [mailto:[EMAIL PROTECTED]
To: Struts Users Mailing List
Subject: Re: file upload ACCESS DENIED (AccessControlException)
> Hi,
> I am trying to upload a file using File upload. I get the
> AccessControlException (access denied). We are using Sun One App Server
> 7.0 and Struts 1.2.9.
>
> java.security.AccessControlException: access denied
(java.io.FilePermission

C:\Sun\AppServer7\domains\domain1\server1\generated\jsp\j2ee-apps\AppName\Ap
pName_war\upload_00000000.tmp delete)
>       at java.security.AccessControlContext.checkPermission
> (AccessControlContext.java:269)
>       at
java.security.AccessController.checkPermission(AccessController.java:401)
>       at java.lang.SecurityManager.checkPermission(SecurityManager.java
:524)
>       at java.lang.SecurityManager.checkDelete
> (SecurityManager.java:982)
>       at java.io.File.deleteOnExit(File.java:879)
>       at
org.apache.commons.fileupload.DefaultFileItem.getTempFile(
DefaultFileItem.ja
va:620)
>       at org.apache.commons.fileupload.DefaultFileItem.getOutputStream
> (DefaultFileItem.java:557)
>       at
org.apache.commons.fileupload.FileUploadBase.parseRequest(
FileUploadBase.jav
a:391)
>       at
org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
(Common
sMultipartRequestHandler.java
> :193)
>       at org.apache.struts.util.RequestUtils.populate(RequestUtils.java
:442)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to