I have a groovy file that is trying to call some methods from a Java class that I have set up using docx4j to parse .docx files
When I set up a pure java test program in eclipse, I am able to do this fine. However, when I have my .groovy file set up, I get no compilation errors, but at runtime I get this stack trace:
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: org/docx4j/wml/RPr
at org.jsecurity.web.servlet.JSecurityFilter.doFilterInternal(JSecurityFilter.java:382)
at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180)
Caused by: java.lang.NoClassDefFoundError: org/docx4j/wml/RPr
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:33)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:20)
at ResumeController$_closure8.doCall(ResumeController.groovy:119)
at ResumeController$_closure8.doCall(ResumeController.groovy)
I can't quite figure out what the problem is - here is the relevant portion of thre groovy file:
import mypackage.DocxHelpers.DocxParser;
import org.docx4j.*;
class ResumeController{
def save = {
File f=new File('c:/dev/temp/test.docx');
uploadedFile.transferTo(f);
DocxParser doc=new DocxParser(); //line 119
def resume=doc.openDocx4j(f);
f.delete();
resumeInstance.entireResume=resume;
flash.message="Resume parsed";
render(view:'create',model:[resumeInstance:resumeInstance]);
}
}
My java stuff related to DocxParser is in the src folder under my project folder, and the docx4j jar is in the lib folder.
Do I simply have my imports defined incorrectly, or are the files in the wrong place?