I'm trying to install the docx4j open source java library in an XPages application but so far without success. I have downloaded the docx4j-3.1.0.jar and added it to the \jvm\lib\ext folder on both the domino server and my local machine. I have also added the docx4j-3.1.0.jar to the WebContent\WEB-INF\lib folder using the Package Explorer view, after which I right clicked the .jar and choose "Build Path" -> "Add to build path" so that the .jar now appears under "Referenced Libraries".
In a Java class I'm using to test, I see the message "This element has no attached source and the Javadoc could not be found in the attached Javadoc." My code is as follows:
package TESTPackage;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
public class JavaDoc {
public void createJavaDoc() {
try {
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
wordMLPackage.getMainDocumentPart().addParagraphOfText("Hello Word!");
wordMLPackage.save(new java.io.File("C:\\Temp\\HelloWord1.docx"));
} catch (Exception e) {
e.printStackTrace();
}
}
}
Any suggestions on what else I must do?