4 Replies Latest reply on Apr 20, 2004 8:14 AM by richardzheng

    How to disenable /tmp in Jetty

    richardzheng Newbie

      I deployed a J2EE/EJB application under Linux 7.2 and JBoss 3.2.1. It works very well for 2 weeks. After 2 weeks the web application has no response so that I have to kill Jboss and restart it again. It seems like the Jboss hangs.

      Lothar suggested that the /tmp folder should be cleaned every 2 weeks using cron job. But I can't clean it because it is used by the user. So I want to disenable /tmp so that the temporary files are not generated automatically.

      Anybody can help me with this. Thanks in advance.

      Richard

        • 1. Re: How to disenable /tmp in Jetty
          Jon Barnett Master

          Actually, the problem is that a periodic Linux cron job cleans the /tmp directory and the embedded Jetty places the compiled JSP classes in this directory. Deleting these means that the compiled JSP code can no longer be run - hence no web application.

          Create another directory to which Jetty can write its compiled JSP classes.
          e.g. Create a directory /jetty to which JBoss server has permission to write.

          Add to JBOSS_HOME/bin/run.conf the following or append to the JAVA_OPTS definition if it already exists in the file:

          JAVA_OPTS="-Djava.io.tmpdir=/jetty"


          Jetty will now write its compiled JSP classes into that directory. You can check this by running the http://localhost:8080/jmx-console application and then going to the Linux command line and listing the contents of /jetty. You should see some directories and some Java classes in those directories.

          Hope that helps.

          • 2. Re: How to disenable /tmp in Jetty
            richardzheng Newbie

            What difference between putting compiled JSP classes in /tmp and in /jetty.

            Thanks
            Richard

            • 3. Re: How to disenable /tmp in Jetty
              Jon Barnett Master

              A cron job specifically cleans up the /tmp directory. It doesn't clean up the /jetty directory.

              • 4. Re: How to disenable /tmp in Jetty
                richardzheng Newbie

                Jonlee, thank you for your help. If the JSP compiled files are written to /jetty directory, there is no files in /tmp directory. Is it neccessary to clean the /tmp directory using cron job? Can it solve the problem with JBoss application working for the continuous 2 weeks?

                Thanks
                Richard