Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7812825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:38:26+00:00 2026-06-02T04:38:26+00:00

I am trying to upload a file to the database in the form of

  • 0

I am trying to upload a file to the database in the form of a blob during which the file upload program writes a temporary file to the disk.

I’m using Wso2 Stratos application server (based on Tomcat) is preventing such temp file to be written to the disk due to security reasons. I have attached the stack trace of the error.

I’m using Apache Commons Fileupload Library. Here is my upload class http://paste.org/47685 and The error is throwing from line 57. I need to avoid writing temp files How can I solve this problem?

This is my error log

java.security.AccessControlException: access denied (java.io.FilePermission F:\W
SO2ST~1.2\bin\..\tmp\upload_4e2fd9dc_1368bb5a330__7ffa_00000002.tmp write)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:323)
    at java.security.AccessController.checkPermission(AccessController.java:
546)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkWrite(SecurityManager.java:962)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:169)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
    at org.apache.commons.io.output.DeferredFileOutputStream.thresholdReache
d(DeferredFileOutputStream.java:178)
    at org.apache.commons.io.output.ThresholdingOutputStream.checkThreshold(
ThresholdingOutputStream.java:224)
    at org.apache.commons.io.output.ThresholdingOutputStream.write(Threshold
ingOutputStream.java:128)
    at org.apache.commons.fileupload.util.Streams.copy(Streams.java:103)
    at org.apache.commons.fileupload.util.Streams.copy(Streams.java:66)
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
ase.java:366)
    at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(
ServletFileUpload.java:126)
    at controler.UploadDocumentServlet.doPost(UploadDocumentServlet.java:62)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:273
)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:270
)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:3
05)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.
java:165)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:298)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(Applicatio
nFilterChain.java:57)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilt
erChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilt
erChain.java:189)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:462)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:100)
    at org.wso2.carbon.server.CarbonStuckThreadDetectionValve.invoke(CarbonS
tuckThreadDetectionValve.java:154)
    at org.wso2.carbon.server.TomcatServer$1.invoke(TomcatServer.java:254)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
563)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:399)
    at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcesso
r.java:396)
    at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.pr
ocess(Http11NioProtocol.java:356)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoin
t.java:1534)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
    at java.lang.Thread.run(Thread.java:705)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T04:38:28+00:00Added an answer on June 2, 2026 at 4:38 am

    I figured out how to solve this temp file issue.
    By default DiskFileItemFactory() size is 10,240 byts, it a file exceed this amount it will create a temp file for storing the file. So that’s the bug my files are more than 10,240 byts size. So by increasing the size of the filefactory object solves the problem. refer this link
    http://www.techiepark.com/tutorials/file-upload-using-java

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to upload a file to the server using a HTTP multipart form
I'm currently trying to upload a csv file to a database through simple html
I was trying to upload file(s) using PrototypeJs request method but I failed. The
I'm trying to upload a file using Watin and C#. Under Windows XP, Watin
I am trying to upload a file using commons-fileupload-1.1.1.jar file (I know it is
I am trying to upload a file via a form and then save in
I am trying to upload images via a form which sits in partial view
I am trying to upload a CSV file to Oracle database from my client
I am trying to upload multiple images using meioupload which works fine if I
I'm trying to upload a file using ASIFormDataRequest ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:[NSURL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.