Dear reader of Juri's TechBlog,
I moved my blog to a new domain and a new hosting solution as well. I'm now blogging on juristr.com.

Tomcat: "IllegalStateException: No output folder"

Today, I started to create a couple of JSP pages for the server-side part of my MSc thesis project in order to be able to output some meaningful statistics of the underlying data in form of diagrams. The server was already based on Tomcat and Spring because the mobile client transmits the data over XML-RPC HTTP to an appropriate Spring controller which handles the requests. So everything I needed to do was to

  • create a "jsp" folder inside the WEB-INF directory
  • inside the "jsp" folder, create a jsp file with the desired content
  • create a Spring controller, which returns as ModelAndView the jsp page
  • create a ViewResolver bean in the spring configuration
  • define a correct mapping in the SimpleUrlHandlerMapping that points to the before created controller
That was it, everything seemed to work, but when I made a request I got
org.apache.jasper.JasperException: java.lang.IllegalStateException: No output folder

The problem here were incorrectly set permissions on the Tomcat installation folder. Basically, the installation was done under the root user while the application started as the user with which I was currently logged on at my machine. To solve this it's enough to do the following:
chown -R Juri apache-tomcat-6.0.29

Posts you might also be interested in..

Credits: Hoctro | Jack Book

9 Comments:

Anonymous said...

I've been struggling with this for a while now. I hope this works.

In:
'chown -R Juri apache-tomcat-6.0.29'

Is 'Juri' the user? Or the Root?

Juri Strumpflohner said...

Hi,

"Juri" is my name, i.e. the user that starts tomcat. :)

bye

Anonymous said...

Brilliant thanks, I'll give it a try.
I made a separate 'tomcat' user account for the tomcat service. But I get multiple errors upon deploying my app.

Strange thing is that on my laptop I have the same configuration (only on windows instead of CentOS) and it runs fine there, thus it has to be something related to the permissions.


B.

Janaka said...

Try to delete your app from
CATALINA_HOME/work/Catalina/localhost
and then restart,

Anonymous said...

You Rock! Man!
I was using Sysdeo plugin in eclipse to lunch tomcat 7 and having the exact same problem.

It worked for me. But since I'm using mac, the command is like:
sudo chown -R dachaoli apache-tomcat-7.0.16
and then you have to type in your password~

Renan Moura said...

Awesome, thank's man, solved my problem, fast and effective.

Chris J Kikoti said...

Thanks.
It real helped!!!

giri said...

thx.. it worked..

Ravi said...

Hi i am ravi,i started tomcat server and then tried to tomcat in localhost,then i got this error "java.lang.IllegalStateException: No output folder"
please give me the solution...

Post a Comment