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:
- Deleted the WAR and context directories off of the filesystem
- Restarted Tomcat
- Verified the application was no longer in filesystem and no longer listed in Tomcat manager
- Checked the application into source control with the correct plug-in reference, which triggered CI build and deploy to dev. integration
- Smoke test
It shows internal server error after Grails installation. Is that related with
Java Hosting apps permissions or tomcat instance?