Issue with Tomcat deployment after Grails upgrade 2.0.1 -> 2.2.1

I have been in the process of upgrading all of our existing Grails applications from version 2.0.1 to version 2.2.1. On one particular project I upgraded earlier today, everything worked fine until I attempted to deploy the application to our dev. integration environment. At that point, Tomcat throw the following error when attempting to deploy:

java.lang.NoClassDefFoundError: org/apache/tomcat/PeriodicEventListener

After some research, I looked again and realized that indeed the upgrade script had left the Tomcat plug-in installed via application.properties instead of placing a reference into BuildConfig.groovy, which is the recommended approach. (It also re-installed Hibernate, which we don’t use on this particular application. The upgrade script ALWAYS installs Hibernate!). Here is the correct BuuildConfig.groovy entry:

plugins {
   // other plug-ins
   build ":tomcat:$grailsVersion"
   // ...
}

Once the deployment had failed via the Tomcat Manager, the application was no longer listed but it still resided on the filesystem, and later deployments could not overwrite the files. Here are the steps I had to take to resolve the deployment issue:

  1. Deleted the WAR and context directories off of the filesystem
  2. Restarted Tomcat
  3. Verified the application was no longer in filesystem and no longer listed in Tomcat manager
  4. Checked the application into source control with the correct plug-in reference, which triggered CI build and deploy to dev. integration
  5. Smoke test
This entry was posted in Deployments, Grails and tagged , , , , , , , , , . Bookmark the permalink.

1 Response to Issue with Tomcat deployment after Grails upgrade 2.0.1 -> 2.2.1

  1. sreejith says:

    It shows internal server error after Grails installation. Is that related with
    Java Hosting apps permissions or tomcat instance?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.