Question

I'm trying to use Apache POI within XPages to create a Word document. I have a button which executes some SSJS to call a method from a Java class. However, as soon as the Java code tries to instantiate a new object, an error occurs. Here is my code:

SSJS:

importPackage(TESTPackage);
var jce:WordReferenceTest = new WordReferenceTest();
jce.newWordDoc();

Java:

package TESTPackage;
import org.apache.poi.xwpf.usermodel.*;

public class WordReferenceTest {

public void newWordDoc() {

    try {   

    XWPFDocument doc = new XWPFDocument();

    }  catch (Exception e) {
        e.printStackTrace();
    }

}

}

I have IBM Notes 9.0 and have imported all the Apache POI JAR files as JARS directly into my database. The error message I get is Error 500 HTTP Web Server: Command Not Handled Exception

Était-ce utile?

La solution

On OpenNTF there is OpenNTF Essentials. It contains everything that you need to handle word documents. Try to use that. You might run foul of security or logging.

Reuse what is there already.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top