Summary: | docx file Can't read content types part ! | ||
---|---|---|---|
Product: | POI | Reporter: | Murali Krishna <murali.n> |
Component: | XWPF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WORKSFORME | ||
Severity: | critical | ||
Priority: | P1 | ||
Version: | 3.8-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | POI XWPFDocument Exception screenshot. |
Description
Murali Krishna
2012-07-20 12:31:46 UTC
Could this be .net related? If you run the same code in pure java, does that work? Hi Nick, As i am a .NET devloper i am using the POI as mentioned in the issue description. Since i does not know how to work with Java could you please assign this to some of your team member and ask them whether this work correctly or not. Thanks & Regards, N.Murali Krishna. POI is Java project and we only accept bug reports reproducible in Java, not in .NET and other POI derivatives. To run a simple Java test you don't need to be a Java expert, just install JDK, compile and run the following simple code (it is actually what you are running in NET): class Test { public static void main(String[] args){ XWPFDocument document = new XWPFDocument(OPCPackage.open(args[0])); POIXMLProperties.CoreProperties coreProperties = document.getProperties().getCoreProperties(); } } If you still can reproduce the problem, please upload a sample .docx file so that we reproduce it on our side. Hi, I'm using 3.9 with Eclipse Juno to read Excel files and get the same problem. It works with Eclipse but not in jar files in the Appian Environment. fileName="C:\\myfold\\test2.xlsx"; log("file " + fileName ); File file = new File(fileName); OPCPackage opcPackage; XSSFWorkbook myWorkbook = null; opcPackage = OPCPackage.open(file); myWorkbook=new XSSFWorkbook(opcPackage); <== Exception opcPackage.close(); org.apache.poi.openxml4j.exceptions.InvalidFormatException: Can't read content types part ! at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.<init>(ContentTypeManager.java:107) at org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager.<init>(ZipContentTypeManager.java:56) at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:167) at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:662) at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:248) at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:200) at com.solypse.etde.SolImportExcel.ReadFile(SolImportExcel.java:186) at com.solypse.etde.SolImportExcel.run(SolImportExcel.java:104) Without a sample we cannot do much about this here, please reopen this bug with a sample-file if this is still a problem for you with a recent version of POI. |