Recently I had an issue with just about all of the Grails apps on my machine.
When I tried to run them, I was getting this error:
| Packaging Grails application..... | Error Tomcat plugin classes JAR grails-plugin-tomcat-7.0.42.jar not found | Running Grails application Error: Could not find or load main class org.grails.plugins.tomcat.fork.ForkedTomcatServer | Error Forked Grails VM exited with error
The number for the jar file would be different for different versions of Grails.
What I finally did to get rid of the error was:
- Run “grails clean; grails compile; grails list-plugins”
- Comment out the line for the Tomcat plugin in BuildConfig.groovy
- Run “grails clean; grails compile; grails list-plugins” again
- Uncomment the line for the Tomcat plugin
- Run “grails clean; grails compile; grails list-plugins” again
Maybe the first “grails clean; grails compile” is unnecessary. But this seemed to work.
I have no idea what caused it. It happened with various versions of Grails. I had no problem with new Grails apps, or with apps downloaded from Github.
You’re welcome.