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 8631181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:10:59+00:00 2026-06-12T09:10:59+00:00

My server side is a JSP application which is hosted on Appache Tomcat 7(Plugin

  • 0

My server side is a JSP application which is hosted on Appache Tomcat 7(Plugin in eclipse). my Client side is: –

if(("GET").equalsIgnoreCase(request.getMethod())&&("Create Reimbursement").equalsIgnoreCase(request.getParameter("Create Reimbursement"))){ 
//crresult = lmktweb.createReimbursement(Integer.parseInt(request.getParameter("ID")), request.getParameter("EmpdID"), request.getParameter("DateCreated"), request.getParameter("Amount"),request.getParameter("Vendor"),request.getParameter("picpath"));
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://192.168.80.125:8080/UploadFileServerSide/UploadHandler.jsp");
MultipartEntity entity = new MultipartEntity();
System.out.println(request.getParameter("fname"));
if(request.getParameter("fname")!=""){
    File file = new File(request.getParameter("fname"));
    entity.addPart("data", new FileBody(file));
    httppost.setEntity(entity);    
    HttpResponse resp = httpclient.execute(httppost);
}

My Server Side is: –

try {
                        String itemName = item.getName();
                        String fpath = "";
                        //item.
                        File root=File.listRoots()[0];
                        String extPath;
                        if(crdate!=""){
                            extPath = rei.HandlePathWithDate(crdate,getServletContext().getRealPath("images"));
                            fpath = extPath+"\\"+ppath;
                            fpath = extPath.replaceAll("/", "\\");
                        }   
                        else{

                            extPath= getServletContext().getRealPath("/");
                            fpath = extPath.concat("\\"+itemName);                              
                            fpath = extPath.replaceAll("/", "\\");                          

                        }
                        System.out.println("Saving as: " +fpath);
                        File f = new File(fpath);

                        f.setWritable(true);
                        f.setReadable(true);
                        item.write(f);

                    } catch (Exception e) {
                        e.printStackTrace();
                        response.setHeader("Error", e.getMessage());                            
                    }

but it generates following error while writing the file on given path: –

Saving as: D:\Z-Main\Projects\Android Projects.metadata.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\UploadFileServerSide\
java.io.FileNotFoundException: D:\Z-Main\Projects\Android Projects.metadata.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\UploadFileServerSide (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:426)
at org.apache.jsp.UploadHandler_jsp._jspService(UploadHandler_jsp.java:154)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1812)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Where is the problem. I am currently using Tomcat Eclipse plugin and this error comes on the console. I am calling the same code in android application and it is working fine.
Please guide with helpful details. I have tried to edit the catalina.policy file which is located in eclipse server plugin folder and added the following line: –

grant codeBase " file:${catalina.base}/webapps/UploadFileServerSide/-" {
  ermission java.io.FilePermission "${tomcat.home}/-","read,write"; };

and restarted the server from eclipse, expecting for different results but so far no luck.
Where am I lost?

  • 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-12T09:11:00+00:00Added an answer on June 12, 2026 at 9:11 am

    Problem is solved when I used Servlet rather than JSP and use POST method while submitting the page. Strange!!!! as rest of the stuff is the same almost. Still confused why it happened as I think Servlet has the same level of access rights on server as of JSP. May be my assumption is wrong!

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

Sidebar

Related Questions

I'm developing an web app with jsp,servlet in server side and javascript in client
i am doing a client-server Application.The client software is a GUI which is made
When I send a request from JSP FORM, the server side automatically parses data
From PC (server side) the C#.Net application has to sent 22000 bytes of data
I have a server-side code using .NET Remoting to establish the connection with client.
I want something similar with php/jsp in java, but not on the server side,
Hi how to get json array elements in different ids in response? //server side
This is my Server side coding on to the JSP <html> <head> </head> <%
My web side I am using Jsp and jQuery and my server side I
My web side I am using Jsp and jQuery and my server side I

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.