Derek
Derek

Reputation: 11905

Jars in my grails project not being picked up when deployed to tomcat 5.5

I am running a grails test run-app all day with my application and it is fine. I type "grails prod war" to get a war, and dump it in the webapps folder of my tomcat install. Now i get the message like so:

11.11.2010 16:35:11 *ERROR* GrailsExceptionResolver: Executing action [index] of controller [ResumeController]  caused e
xception: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Context (GrailsExceptionResolver.ja
va, line 72)
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [index] of controll
er [ResumeController]  caused exception: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Cont
ext
        at org.jsecurity.web.servlet.JSecurityFilter.doFilterInternal(JSecurityFilter.java:382)
        at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: Could not initialize
class org.docx4j.jaxb.Context
        ... 3 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Context
        at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:599)
        at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:199)
        at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:188)
        at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:188)
        at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:169)
        at com.iai.skillsdb.DocxHelpers.DocxParser.openDocx4j(DocxParser.java:70)
        at ResumeController$_closure8.doCall(ResumeController.groovy:164)
        at ResumeController$_closure8.doCall(ResumeController.groovy)
        at ResumeController.invokeMethod(ResumeController.groovy)
        at ResumeController$_closure1.doCall(ResumeController.groovy:41)
        at ResumeController$_closure1.doCall(ResumeController.groovy)
        ... 3 more

What is causing this? I have the docx4j jar in my WAR for sure, and it is there in the web-inf lib folder as well.

Upvotes: 2

Views: 1417

Answers (2)

Burt Beckwith
Burt Beckwith

Reputation: 75681

You're getting a java.lang.NoClassDefFoundError, not a java.lang.ClassNotFoundException. The class is being loaded, but a class that it depends on (directly or indirectly via another class) isn't there. You're most likely missing a jar that docx4j requires as a dependency.

Upvotes: 3

abarax
abarax

Reputation: 6299

Make sure that you have the correct version of docx4j and that there is absolutely no other version of docx4j in your classpath, there may be a version of this lib that did not have the 'Content' class implemented.

Upvotes: 0

Related Questions