Oromis
Oromis

Reputation: 347

How can I deploy a Grails 3 app on Tomcat 7?

I have a Grails application which I would like to deploy to a tomcat instance. Relevant versions of libraries in use:

Grails Version: 3.2.0
Groovy Version: 2.4.7
JVM Version: 1.7.0_79
Tomcat Version: 7.0.39

I built a WAR file (using grails war), uploaded it to the server, placed it in the webapp directory and restarted tomcat. The WAR file was unpacked as usual, but when trying to access the webapp's index page, it just returns error 404. If I manually place a file called ìndex.html` in the webapp's directory, then this file is served. I therefore conclude that tomcat didn't start the app at all.

I tried to check the logs for errors, but catalina.out is nearly empty. A redeploy of my webapp yields the following log output:

INFO: Reloading Context with name [/myapp] has started
Oct 18, 2016 1:56:30 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/<tomcat-path>/webapps/myapp/WEB-INF/lib/javax.el-api-2.2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
Oct 18, 2016 1:57:43 PM org.apache.catalina.core.ApplicationContext log
INFO: 1 Spring WebApplicationInitializers detected on classpath
Oct 18, 2016 1:57:43 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/myapp] is completed

I can't see any critical error in there. One thing I am suspicious of is the fact that my project doesn't have a web.xml file, but I read that this is inteded in Grails 3 and servlet container > version 3.0 don't need a web.xml any more (tomcat 7 supports servlets version 3.0). Things I've tried:

All attempts had no effect whatsoever. I am very grateful for any hints, further debugging tips or things I might have overlooked.

Thanks in advance!

Upvotes: 4

Views: 1621

Answers (1)

Graeme Rocher
Graeme Rocher

Reputation: 7985

This is a Grails bug and will be fixed in 3.2.1 to be released today. See the following command for a solution for 3.2.0:

https://github.com/grails/grails-core/issues/10196#issuecomment-251155196

Upvotes: 1

Related Questions