docx4j2.8.0.jar not working using grail-Collection of common programming errors
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 deploy it in Jboss 6.0 of my linux os. While reading a docx file using WordprocessingMLPackage.load(inputStream) method of docx4j.jar I am getting error:
WordprocessingMLPackage inputMLPackage = WordprocessingMLPackage.load(inputStream);
2012-10-31 06:32:54,861 ERROR [org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver] (http-10.189.8.11-8080- 2) Exception occurred when processing request: [POST] /HBG_PM/report/buildItinerary
Stacktrace follows:: org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [buildItinerary] of controller [com.hbg.pm.controller.report.ReportController] caused exception: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Context
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:679) [:1.6.0_22]
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Context
... 8 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Context
at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:666) [:]
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:206) [:]
at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:193) [:]
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:301) [:]
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:245) [:]
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:213) [:]
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:184) [:]
at org.docx4j.openpackaging.packages.WordprocessingMLPackage$load.call(Unknown Source)
at com.hbg.pm.controller.report.ReportController.processBodyHeaderFooter(ReportController.groovy:2517) [:]
at com.hbg.pm.controller.report.ReportController$_closure1.doCall(ReportController.groovy:198) [:]
at com.hbg.pm.controller.report.ReportController$_closure1.doCall(ReportController.groovy) [:]
... 8 more
If I am trying do same thing using dynamic web project there is no error. What cause this? As I am having docx4j jar in my web inf lib
Thanks