42

I am new to Tomcat on Windows. I am trying to deploy my Java project which I have made in RHEL 5 using Tomcat. Now I want to run that project on window. So I copied and pasted my project folder inside the Tomcat web apps Directory

i.e C:\Program Files\apache-tomcat-6.0.37\webapps

but I am unable to run the project as I am facing below error while opening my first login page. Do I need to make any further changes in code or web.xml file as I am now deploying it on Windows?

type Exception report

message java.lang.IllegalStateException: No output folder

**Description** The server encountered an internal error that prevented
it from fulfilling this request.

Exception

org.apache.jasper.JasperException: java.lang.IllegalStateException: No output folder
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:538)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
root cause

java.lang.IllegalStateException: No output folder
    org.apache.jasper.JspCompilationContext.createOutputDir(JspCompilationContext.java:678)
    org.apache.jasper.JspCompilationContext.getOutputDir(JspCompilationContext.java:197)
    org.apache.jasper.JspCompilationContext.getClassFileName(JspCompilationContext.java:514)
    org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:453)
    org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:399)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.37 logs.
3
  • 2
    This is for Tomcat 7, but I think is the same problem you have: stackoverflow.com/questions/10577494/…
    – morgano
    Commented Aug 21, 2013 at 4:17
  • 4
    Install tomcat outside of programs folder or give the user who runs tomcat the rights to write in this folder. Windows disables direct file access to programs folder for normal users per default
    – Matthias
    Commented Aug 21, 2013 at 4:27
  • Faced same issue right after setting the apache server. Changed the location of apache folder from inside the "program files" (same as you) to the C root "C:\apache-tomcat-9". And the issue got resolved. Earlier I tried to change the permissions and access rights for the folder and tried reinstalling apache but it did not work. Hope this helps someone visiting this question in future.
    – akzhere
    Commented Mar 18, 2018 at 10:15

12 Answers 12

66

I have given complete access to my Tomcat Directory. Now i am not getting this error. Thanks !!

1
  • 2
    It's helpfull, but solution is non-trivial. It's about 5-10 steps to do it on W10. Commented Sep 30, 2019 at 12:24
25

I was facing the similar problem on ubuntu 14.04. I was doing some analysis and dropped the work folder manually. Then while running the tomcat server I was getting same exception. The issue was, when we access the manager application of tomcat, it requires jsp page to display the content, and JSP page is rendered from the generated class file which resides in work/Catalina/localhost/.... folder.

I created the work directory manually, however the problem was still not solved.

Then I realized that, because I manually created the work directory tomcat7 user didn't have the permission to write on that directory. Changed the owner for work directory from root to tomcat7

sudo chown tomcat7 work

restart tomcat service tomcat restart.

Problem solved.

Hope this helps

1
  • 1
    Same issue arises if you remove tomcat’s cache directory (e.g. /var/cache/tomcat/). For some reason tomcat won’t recreate it automatically. Same solution : create it manually, update owner, and restart. Commented Oct 6, 2020 at 10:41
7

If you are on Linux/Unix and facing the issue:

STEPS:

Note the User and the service ,in my case it was tomcat yours could be anything else...

1. mkdir work
2. sudo chown tomcat work  
3. service tomcat6 restart
2

As your start tomcat as the root account firstly, the work folder was already created. You run tomcat as the account tomcat, as tomcat account has no permission to the folder ./work, so throw the exception. To solve it, ps remove ./work, and then restart tomcat by the tomcat user.

1
  • results in Starting Tomcat servlet engine: tomcat8/etc/init.d/tomcat8: 202: /etc/init.d/tomcat8: cannot create /var/lib/tomcat8/work/catalina.policy...y nonexistent so it no longer tries to create the work directory... you have to create it your self. and after that you still end up with IllegalStateException: No output folder till you create the Catalina directory on your own. Commented Nov 5, 2015 at 16:56
2

Check your Disk space ?

I also got this error when my / partition had filled up. Freeing up some disk space removed this error for me.

2

I have changed the permissions for the work directory and it's working...

Steps:
1. Go to the directory where tomcat is present
2. Execute the command:
sudo chmod 777 work

0

Try restarting the server completely (if applicable)

0

Grant all permissions to the tomcat directory.

sudo chmod -R 777 /path/to/tomcat/directory

mine was "/opt/tomcat/"

It worked for me. Hope it helps.

Note : Don't forget sudo

0

I had the same problem. Turned out it was because I placed it in Program Files and Windows didn't let Tomcat do any changes. I've just moved apache-tomcat folder to a different location.

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Dec 5, 2021 at 0:01
-1

give the full permission to tomcat directory and then restart the service.It will works for me ,I hope this will work you as well.

-1

It can be because of lack of write permissions to cache directory (/var/lib/tomcat6 on Linux). If this is your case, use the following commands to grant full access and restart Tomcat:

sudo /etc/init.d/tomcat6 stop
sudo chown -R tomcat6 /var/lib/tomcat6
sudo chmod -R 777 /var/lib/tomcat6
sudo /etc/init.d/tomcat6 start

If this was working for you previously, sometimes the work directory is simply in a bad state and you can fix it by simply deleting it and allowing Tomcat to create a new one from scratch.

-1

De permissão total ao diretório apache. No windows botão direito do mouse propriedades->seguranca->avançadas->permissões->adicionar

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.