Deploying Grails app to Tomcat always results in http 404

I'm beginning grails development but just cannot make IntelliJ deploy a newly created grails app to a local Tomcat. I always get http 404 on the index.gsp. However, when I open the manager app in Tomcat, it shows that the application is up and running. I can even download the file js/application.js - it just seems that grails doesn't kick in.
Of course it works perfectly when I build a war file and copy that into webapps.

These are the versions I used:

  • IntelliJ IDEA 12.1.6 Ultimate
  • Grails 2.2.4 and 2.3.2
  • Tomcat 7.0.47 and 6.

These are the detailed steps I took several times, even on different computers, always with same result:

  • create a new grails app in IntelliJ and launch default run configuration (grails) - so far that's working fine.

  • set up deployment to a local Tomcat server. I've configured the application server in IntelliJ, creating an artifact (Web Application: Archive or Web Application: Exploded) using the GrailsWeb facet and assigned it to be deployed.

  • start the local application server and IntelliJ would report that the artifact is deployed successfully

  • opening the browser will give 404

WHY? What am I doing wrong?

It must be something about grails, because I was able to pull an example Java application (spring-petclinic) from github and simply run it in Tomcat without trouble...

I've noticed that I can manually deploy the war generated using "Make Grails Web archive". But when I do the same with the war-file of the artifact under out/... it won't work.
Obviously the latter one wasn't generated correctly: its missing MANIFEST.MF under META-INF and there's also no grails.xml and grails-app under WEB-INF!

directory comparison

Could you please have a look at the facets: Is there something wrong?

IntelliJ project structure

Please sign in to leave a comment.