Solved

$CATALINA_TMPDIR No such file or directory

Posted on 2007-04-04
5
1,701 Views
Last Modified: 2013-12-02
I have a problem that is occuring in a production environment but the problem does not occur in a development and test environment.  The problem in production happens when uploading a file.  The error is:

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Processing of multipart/form-data request failed. $CATALINA_TMPDIR/upload_00000546.tmp (No such file or directory)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:309)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:387)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
      at java.lang.Thread.run(Thread.java:534)


root cause

javax.servlet.ServletException: Processing of multipart/form-data request failed. $CATALINA_TMPDIR/upload_00000546.tmp (No such file or directory)
      at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
      at org.apache.jsp.voicemail_jsp._jspService(voicemail_jsp.java:1888)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:309)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:387)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
      at java.lang.Thread.run(Thread.java:534)



--------------------------------------------------------------------------------

Apache Tomcat/4.1.29-LE-jdk14

The JSP code used to upload the file is:

boolean bIsMultipart = FileUpload.isMultipartContent(request);
if (bIsMultipart) {
      DiskFileUpload upload = new DiskFileUpload();

      // Parse the request
      java.util.List /* FileItem */ items = upload.parseRequest(request);
      psCollection formFields = new psCollection();

      Iterator iter = items.iterator();

      while (iter.hasNext() && !bErrorFlag) {
            boolean bFileExists = false;
            FileItem item = (FileItem) iter.next();
            if (item.isFormField()) {
                  //first get the all the data entered.  Process the data after the while loop
                  formFields.add(new String(item.getString()), new String(item.getFieldName()));
            } else {
                  sName = item.getFieldName();
                  sFileName = item.getName().substring(item.getName().lastIndexOf("\\") + 1);
                  sContentType = item.getContentType();
                  bInMemory = item.isInMemory();
                  lSizeInBytes = item.getSize();
                 
                  // Process the file upload in memory
                  try {
                        data = item.get();
                  } catch (Exception e) {
                        bErrorFlag = true;
                        sDisplayMessage = "We were unable to access the uploaded file.";
                        logger.debug("unable to get the data from the file.");
                  }



The main difference between the development/test environment and the production environment is that the development/test environment have Apache and Tomcat on the same server while the production environment has one server running Apache and another server running Tomcat.
0
Comment
Question by:david_m_jacobson
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
Farzad Akbarnejad earned 250 total points
ID: 18854983
Create a folder name 'temp' in beside of bin and webapp. Then start the tomcat and test uploading file.
0
 
LVL 2

Assisted Solution

by:ckyteh
ckyteh earned 250 total points
ID: 19055015
As FarzadA said, you need to create a temp directory for Tomcat to use. You also need to make sure Tomcat is configured appropriately to use the temp directory that you created ($CATALINA_TMPDIR variable). Finally, this temp directory needs the appropriate permissions to allow the Tomcat service to write to the directory.
0
 
LVL 14

Expert Comment

by:Farzad Akbarnejad
ID: 19060883
david_m_jacobson,
ckyteh's comment is a perfect answer. I see the structural thinking in that answer.

-FA
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question