Hi,
attached is a simple docx file that was created by Word 2010 and it cannot be parsed by docx4j 2.5.0: it throws this exception:
org.docx4j.openpackaging.exceptions.Docx4JException: Failed to add parts from relationships
at org.docx4j.openpackaging.io.LoadFromZipNG.addPartsFromRelationships(LoadFromZipNG.java:346)
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:229)
at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:182)
(...)
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Failed to add parts from relationships
at org.docx4j.openpackaging.io.LoadFromZipNG.addPartsFromRelationships(LoadFromZipNG.java:346)
at org.docx4j.openpackaging.io.LoadFromZipNG.getPart(LoadFromZipNG.java:436)
at org.docx4j.openpackaging.io.LoadFromZipNG.addPartsFromRelationships(LoadFromZipNG.java:344)
... 22 more
Caused by: java.lang.IllegalArgumentException: part
at org.docx4j.openpackaging.parts.relationships.RelationshipsPart.loadPart(RelationshipsPart.java:390)
at org.docx4j.openpackaging.io.LoadFromZipNG.getPart(LoadFromZipNG.java:420)
at org.docx4j.openpackaging.io.LoadFromZipNG.addPartsFromRelationships(LoadFromZipNG.java:344)
... 24 more
I have found the reason why parsing fails: the [Content_Types].xml file contains a mapping for extension "PNG", but the package also contains files with extension "png" (word/media/image3.png) and docx4j is not able to determine the content type if the capitalization of the extension is not exactly the same as in the mapping file. I think the mapping should be case insensitive, I think that specification says it.
Now I am not able to create such a file again with Word, but definitely such a document can be produced by Word and it is a document with just text and images, so I consider this to be quite a severe issue that would be nice to have fixed soon;-).
Best regards,
Jiri