birdy
birdy

Reputation: 9636

how to access grails application on Tomcat

I'm trying to deploy a simple grails application on my test-server which is tomcat. I've built the WAR with grails war command so I've got a war file named: simplgrailsapp-0.1.war

When I deploy this to tomcat I'm getting a lot of errors which I'm going to resolve one-by-one. But the URL for the app from tomcat manager (mytestserver:8080/manager) is http://mytestserver:8080/simplegrailsapp-0.1/ which doesn't seem correct. Because when I run the app locally the url is: localhost:8080/simplegrailsapp

I've also tried to access the app by http://mytestserver:8080/simplegrailsapp but that doesn't work either.

How can I fix this?

Upvotes: 0

Views: 187

Answers (1)

Gregg
Gregg

Reputation: 35864

By default, when you deploy a WAR to tomcat it will fall under the context of the name of the WAR file. So in your case, the context becomes simplegrailsapp-0.1. You can:

  • rename your war file to whatever you want the context to be before you deploy it
  • define a Context for the application in Tomcat

If you go with defining a context this can be added to the WAR file by creating a META-INF folder in the web-app folder of your project and creating the context.xml file there.

Upvotes: 3

Related Questions