Java.io.IOException:No such file or directory solution permissions issues

Source: Internet
Author: User

Post the exception information first:

Java.io.IOException:No such file or directory at java.io.UnixFileSystem.createFileExclusively (Native method) At Java.io.File.createNewFile (file.java:883) at Com.bill99.prm.query.controller.FileUploadController.upload (Fi leuploadcontroller.java:143 in Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method) at Sun.reflect . Nativemethodaccessorimpl.invoke (nativemethodaccessorimpl.java:39) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (DELEGATINGMETHODACCESSORIMPL.JAVA:25) at Java.lang.reflect.Method.invoke (method.java:597) at Org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod ( multiactioncontroller.java:473) at Org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal ( multiactioncontroller.java:410) at Org.springframework.web.servlet.mvc.AbstractController.handleRequest ( abstractcontroller.java:153) at Org.springframework.web.Servlet.mvc.SimpleControllerHandlerAdapter.handle (simplecontrollerhandleradapter.java:48) at Org.springframework . Web.servlet.DispatcherServlet.doDispatch (dispatcherservlet.java:875) at Org.springframework.web.servlet.DispatcherServlet.doService (dispatcherservlet.java:809) at Org.springframework.web.servlet.FrameworkServlet.processRequest (frameworkservlet.java:571) at Org.springframework.web.servlet.FrameworkServlet.doPost (frameworkservlet.java:511) at Javax.servlet.http.HttpServlet.service (httpservlet.java:637) at Javax.servlet.http.HttpServlet.service ( httpservlet.java:717) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (Applicationfilterchain  . java:290) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:206) at Com.bill99.subintra.controler.SessionFilter.doFilterInternal (sessionfilter.java:86) at Org.springframework.web.f Ilter. Onceperrequestfilter.dofIlter (onceperrequestfilter.java:76) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter ( applicationfilterchain.java:235) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (
        applicationfilterchain.java:206) at Edu.yale.its.tp.cas.client.filter.CASFilter.doFilter (casfilter.java:457) At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:235) at Org.apa Che.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:206) at Org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal (characterencodingfilter.java:96) at Org.springframework.web.filter.OncePerRequestFilter.doFilter (onceperrequestfilter.java:76) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:235) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:206) at Org.apache.catalina.cOre. Standardwrappervalve.invoke (standardwrappervalve.java:233) at Org.apache.catalina.core.StandardContextValve.invoke (standardcontextvalve.java:191) at Org.apache.catalina.core.StandardHostValve.invoke (standardhostvalve.java:127) at Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:102) at Org.apache.catalina.valves.AccessLogValve.invoke (accesslogvalve.java:615) at Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:109) at Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:293) at Org.apache.coyote.http11.Http11Processor.process (http11processor.java:859) at Org.apache.coyote.http11.http11protocol$http11connectionhandler.process (http11protocol.java:602) at Org.apache.tomcat.util.net.jioendpoint$socketprocessor.run (jioendpoint.java:396) at Java.util.concurrent.threadpoolexecutor$worker.runtask (threadpoolexecutor.java:886) at Java.utIl.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:908) at Java.lang.Thread.run (thread.java:662 )


There are a lot of scenarios for this type of problem, I was helping the project team solve this problem when I found that the folder was created on the server and the file could not be created, verified that the directory belongs to the user is root, is not our user Oracle, resulting in the inability to create directories and files, so there is no Exceptions such as such file or directory.

The solution is as follows:

To modify the user to which a file or directory belongs by using the Chown command:
Command: Chown user directory or file
For example: Chown oracle/xx/yy (Change the owner of the YY directory under the XX directory to Oracle users)
Attachment: Use the CHGRP command to modify the group to which the file or directory belongs:
Command: CHGRP group directory or file name
For example: Chgrp oracle/xx/yy (change the group of YY directory under XX directory to Oracle Group)


The problem is very simple, only for the introduction of the brothers can refer to


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.