I try to write a temporary file from a tomcat 7.0 application. It fails:
Servlet code snippet:
File formFile = File.createTempFile("document", ".pdf");
Exception
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(File.java:1879)
at java.io.File.createTempFile(File.java:1923)
at goGet(ServletTest.java:20)}
I guess catalina.policy is in the way. How can I enable temp files for Web Applications?
Tomcat was missing a temp directory.
Above issue got fixed on tomcat by creating a temp directory in tomcat base directory(cataline_home directory).
I found the problem myself: temp directory was missing in tomcat.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With