• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts file upload problem?

 
balu batthala
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Members,

While uploading the files using struts application, I am facing the following problems.

File path to be written is : out side the application system( i.e tring to write in the LAN system),

From normal java i am able to write the file in the particular location, but from the application i am getting the follwoing exception??

2011-03-18 15:53:03,393 ERROR [com.evertech.upload.file.UploadDocumentAction] io exception: java.io.IOException: Access is denied
2011-03-18 15:53:03,393 ERROR [STDERR] java.io.IOException: Access is denied
2011-03-18 15:53:03,393 ERROR [STDERR] at java.io.WinNTFileSystem.createFileExclusively(Native Method)
2011-03-18 15:53:03,393 ERROR [STDERR] at java.io.File.createNewFile(File.java:850)
2011-03-18 15:53:03,393 ERROR [STDERR] at com.evertech.upload.file.UploadDocumentAction.execute(UploadDocumentAction.java:67)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
2011-03-18 15:53:03,393 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
2011-03-18 15:53:03,393 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:419)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
2011-03-18 15:53:03,393 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
2011-03-18 15:53:03,393 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
 
Stefan Evans
Bartender
Posts: 1784
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message is straightforward enough: Access is Denied.

So whatever user Tomcat is running as doesn't have rights to that directory.

On *nix, this is easy to solve: just grant the permissions required :-)

On Windows it is a bit more tricky.
You have Tomcat running as a Service on windows?
Go to the services control panel, edit the properties of the Tomcat service - look for the "log on" tab.
Most probably it would be running on "Local System Account"
Modifying this will potentially resolve your error. Just be aware of the security issues.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
balu batthala
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mr. Stefan...

Can you please let me know how to handle the same scenario in UNIX and LINUX environment?

Can you please provide the detail steps how to provide grant permision in UNIX or LINUX ???

Thanks in Advance...

Balu
 
balu batthala
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stefan Evans wrote:The error message is straightforward enough: Access is Denied.

So whatever user Tomcat is running as doesn't have rights to that directory.

On *nix, this is easy to solve: just grant the permissions required :-)

On Windows it is a bit more tricky.
You have Tomcat running as a Service on windows?
Go to the services control panel, edit the properties of the Tomcat service - look for the "log on" tab.
Most probably it would be running on "Local System Account"
Modifying this will potentially resolve your error. Just be aware of the security issues.
 
balu batthala
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mr. Stefan...

Can you please let me know how to handle the same scenario in UNIX and LINUX environment?

Can you please provide the detail steps how to provide grant permision in UNIX or LINUX ???

Thanks in Advance...

Balu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic