简体   繁体   中英

Tomcat Error - Grails App - NoClassDefFoundError

2011-06-17 09:11:45,277 [main] ERROR com].[/]  - Exception sending context destroyed event to listener instance of class   org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener  
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps;   
nested exception     is org.codehaus.groovy.runtime.InvokerInvocationException:   java.lang.NoClassDefFoundError: testProject.Checkin  

I'm just trying to "new up" a normal Domain class in Grails. Never ran into this before (well I am new to this) I moved the "new" to the BootStrap.groovy just to see if it had something to do with the Controller causing same issue. Nope. Seems like the whole jar unaware of the testProject.Checkin class.
Saw somewhere to try Xverify:none as a Tomcat setting. Where would I set this? What else should I do to troubleshoot the issue?

I am using the latest version of Tomcat 7.0.14

There was a solution presented in the comments above wrt your actual problem but the question you posted regarding how to passing vm args to Tomcat is worth and answer too.

Since grails 1.3.5 you can explicitly pass jvm args to Tomcat when doing

$ grails run-war

to do so, add the following in your Config.groovy file

grails.tomcat.jvmArgs = ["-Xverify:none", "-Xmx1024m", "-XX:MaxPermSize=256m"]

If you are simply running grails run-app then whatever jvm args that are being past to grails will be included in the running tomcat instance since the instance lives within the same JVM.

http://www.grails.org/doc/latest/ref/Command%20Line/run-war.html

Have you checked the basics?

Run 'grails' war', see if your class compiled and is inside the war?

Does it work from grails run-app, but not the tomcat?

What environment are you working in? SpringSource ToolSuite (STS) now provides a Grails "run on server" option for servers managed by Eclipse (ie Tomcat), and can help you get the environment up and running quickly.

Note that Grails 1.3.x ships with Tomcat 6.0.x, the latest 1.4M1 milestone release supports Tomcat7, so you may want to try that.

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