简体   繁体   中英

Deploying a Grails app to a running Tomcat

Our Tomcat instance runs lots of different webapps : mostly Struts/Struts2 but with the odd Grails app thrown in.

If I need to update a Struts app, generally I'll just copy over the tree from my development machine and the app restarts when the web.xml updates.

With Grails it seems a lot more problematic. Copying the tree and having the app restart almost never works ... apparent missing classes, database connection errors, etc. The only thing that I've found definitely works is stopping tomcat completely, updating the application, and restarting tomcat. The apparent missing classes are no longer missing and database connections are fine with no change of any code. However, this obviously takes all the other applications down too.

Has anyone else seen similar issues? Is there a trick I'm missing?

Copying the tree to the application server is discouraged . A preferable way is to package your Grails application as WAR:

# grails war

Or if you configured maven :

# mvn clean package

This makes sure that the 'production' environment is set.

Then you can deploy the WAR file and restart the webapp using the Tomcat Manager if autoDeploy is disabled or not working properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM