I'm trying to load some documents with LoadFromZipFile like it was sugested previously to a collegue at:
docx-java-f6/outofmemory-error-t232.html
I've simply swithed may call to
- Code: Select all
WordprocessingMLPackage.load
with
- Code: Select all
private WordprocessingMLPackage load(File f) throws Docx4JException {
LoadFromZipFile.setConserveMemory(true);
LoadFromZipFile loader = new LoadFromZipFile();
return (WordprocessingMLPackage) loader.get(f);
}
but I'm getting an IOException (full stack trace below) thrown from inside LoadFromZipFile
Am I doing something wrong here?
Thanks for your help.
Best regards,
OF
- Code: Select all
java.io.IOException: mark/reset not supported
at java.util.zip.InflaterInputStream.reset(Unknown Source)
at org.docx4j.openpackaging.io.LoadFromZipFile.getRawPart(LoadFromZipFile.java:559)
at org.docx4j.openpackaging.io.LoadFromZipFile.getPart(LoadFromZipFile.java:366)
at org.docx4j.openpackaging.io.LoadFromZipFile.addPartsFromRelationships(LoadFromZipFile.java:288)
at org.docx4j.openpackaging.io.LoadFromZipFile.getPart(LoadFromZipFile.java:389)
at org.docx4j.openpackaging.io.LoadFromZipFile.addPartsFromRelationships(LoadFromZipFile.java:288)
at org.docx4j.openpackaging.io.LoadFromZipFile.get(LoadFromZipFile.java:178)
at com.ancp.alerts.Docx4jMerger.optimizedLoad(Docx4jMerger.java:143)
at com.ancp.alerts.Docx4jMerger.merge(Docx4jMerger.java:125)
at com.ancp.alerts.Docx4jMerger.merge(Docx4jMerger.java:98)
at com.ancp.alerts.Docx4jMerger.mergeAndLotify(Docx4jMerger.java:74)
at com.ancp.alerts.Docx4jTest.main(Docx4jTest.java:47)
Exception in thread "main" org.docx4j.openpackaging.exceptions.Docx4JException: Failed to add parts from relationships
at org.docx4j.openpackaging.io.LoadFromZipFile.addPartsFromRelationships(LoadFromZipFile.java:290)
at org.docx4j.openpackaging.io.LoadFromZipFile.get(LoadFromZipFile.java:178)
at com.ancp.alerts.Docx4jMerger.optimizedLoad(Docx4jMerger.java:143)
at com.ancp.alerts.Docx4jMerger.merge(Docx4jMerger.java:125)
at com.ancp.alerts.Docx4jMerger.merge(Docx4jMerger.java:98)
at com.ancp.alerts.Docx4jMerger.mergeAndLotify(Docx4jMerger.java:74)
at com.ancp.alerts.Docx4jTest.main(Docx4jTest.java:47)
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Failed to add parts from relationships
at org.docx4j.openpackaging.io.LoadFromZipFile.addPartsFromRelationships(LoadFromZipFile.java:290)
at org.docx4j.openpackaging.io.LoadFromZipFile.getPart(LoadFromZipFile.java:389)
at org.docx4j.openpackaging.io.LoadFromZipFile.addPartsFromRelationships(LoadFromZipFile.java:288)
... 6 more
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Failed to getPart
at org.docx4j.openpackaging.io.LoadFromZipFile.getRawPart(LoadFromZipFile.java:605)
at org.docx4j.openpackaging.io.LoadFromZipFile.getPart(LoadFromZipFile.java:366)
at org.docx4j.openpackaging.io.LoadFromZipFile.addPartsFromRelationships(LoadFromZipFile.java:288)
... 8 more
Caused by: java.io.IOException: mark/reset not supported
at java.util.zip.InflaterInputStream.reset(Unknown Source)
at org.docx4j.openpackaging.io.LoadFromZipFile.getRawPart(LoadFromZipFile.java:559)
... 10 more