larand
larand

Reputation: 831

Deployment of Grails-app using TOMCAT-8.5.9 gives error=500

I made the simplest (test1) app with only one domain (Person) and created views and controller by the command - "grails generate-all Person". Grailsversion is 3.2.3.

I added the line: (grails.app.context: "/") in both development and production in file "application.yml"

Running "grails run-app" works well, you can use the link to the controller "localhost:8080/person/index"

I run "grails war" and it still works but I need to cd into the same directory as the war-file when I run the command: "java -Dgrails.env=development -jar test1-0.1.war".

But then I move it to the webapps-directory of TOMCAT. TOMCAT automatically deploys the application and creates a new directory "test1" for the app.

I can then open the main page i.e. localhost:8011 but when I click on the controllerlink I get the message: "!An error has occurred" A look in the tomcat log:

0:0:0:0:0:0:0:1 - - [08/Jan/2017:09:18:01 +0100] "GET /test1/ HTTP/1.1" 200 6518
0:0:0:0:0:0:0:1 - - [08/Jan/2017:09:18:01 +0100] "GET /test1/assets/application-c6464c75bbfb4d22adc6c621127669df.css HTTP/1.1" 200 25259
0:0:0:0:0:0:0:1 - - [08/Jan/2017:09:18:01 +0100] "GET /test1/assets/application-bef98f3ac7542cc30b757375c6998c5c.js HTTP/1.1" 200 40241
0:0:0:0:0:0:0:1 - - [08/Jan/2017:09:18:01 +0100] "GET /test1/assets/grails-cupsonly-logo-white-b651640f09f462efc43058482f4131d4.svg HTTP/1.1" 200 2156
0:0:0:0:0:0:0:1 - - [08/Jan/2017:09:18:01 +0100] "GET /test1/assets/favicon-9ef27019cc7a636e29ecc851528f716e.ico HTTP/1.1" 200 6508
0:0:0:0:0:0:0:1 - - [08/Jan/2017:09:18:04 +0100] "GET /test1/person/index HTTP/1.1" 500 1942
0:0:0:0:0:0:0:1 - - [08/Jan/2017:09:18:05 +0100] "GET /test1/assets/skin/exclamation-e4dd51f46566ed3ceacdc900bf2fdf01.png HTTP/1.1" 200 701
0:0:0:0:0:0:0:1 - - [08/Jan/2017:09:19:36 +0100] "GET /test1/person/index HTTP/1.1" 500 1942

It doesn't give much but it's all I got. I think the problem is about linking but I have no clues.

Upvotes: 0

Views: 259

Answers (1)

David Brown
David Brown

Reputation: 3071

Could it be your app context causing the problem?

If you want the app to run in the app context you set, i.e '/' then you should rename your war as ROOT.war before deploying in Tomcat.

Upvotes: 0

Related Questions