At the times when i trying to call SaveToZipFile to save to ByteArrayOutputStream , i encounter a NullPointerException, my code is as below:
- Code: Select all
WordprocessingMLPackage template = WordprocessingMLPackage.load(new ByteArrayInputStream(out.toByteArray()));
//start to do something on the template
....
//end
ByteArrayOutputStream outv = new ByteArrayOutputStream();
SaveToZipFile saver = new SaveToZipFile(template);
saver.save(outv);
I am using docx4j 2.7.1 and JDK 1.6.0_31-b05,
can you suggest how to resolve it? The error detail are as below:
java.lang.NullPointerException
at org.docx4j.utils.ResourceUtils.getResource(ResourceUtils.java:45) ...