Search code examples
javajava-web-startnoclassdeffounderrorclassnotfoundexceptiondocx4j

Java-Web-Start gives NoClassDefFoundError in my application to create docx files


I have an application to create .docx files. It works perfectly fine on my local PC, but gives error on java-web-start:

java.lang.NoClassDefFoundError: org/docx4j/fonts/Mapper

Caused by: java.lang.ClassNotFoundException: org.docx4j.fonts.Mapper

Application gives that error when I click my "create docx" button, other features(my gui, db connections..) still work fine. Clicking the button, application opens an existing docx file, adds a table to it and saves the file on my local PC.

Actually 'missing' class is there in docx4j-2.7.0.jar, in the lib folder. Other jar files in the folder also creates no problem. But the docx4j jar file is the largest in size which is 2,67MB. May that be the problem? Or any other suggestions?


Solution

  • Sounds like an import in org.docx4j.fonts.Mapper is not satisfied. Look at the dependencies form docx4j if are in the classpath.

    It might be an error with dependencies in the jnpl.

    <resources> </resources>
    

    Regards.