You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2012/07/20 14:31:46 UTC

[Bug 53576] New: docx file Can't read content types part !

https://issues.apache.org/bugzilla/show_bug.cgi?id=53576

          Priority: P2
            Bug ID: 53576
          Assignee: dev@poi.apache.org
           Summary: docx file Can't read content types part !
          Severity: critical
    Classification: Unclassified
          Reporter: murali.n@comakeit.com
          Hardware: PC
            Status: NEW
           Version: 3.8
         Component: XWPF
           Product: POI

Created attachment 29089
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29089&action=edit
POI XWPFDocument Exception screenshot.

Hi Poi, 

I have downloaded the poi-3.8 version and gathered all the .jar files and used
the ikvmc.exe (7.1.4532.2) to generate the .net dll. I have used the below
command to generate the poi.dll 

>ikvmc.exe commons-logging-1.1.jar dom4j-1.6.1.jar junit-3.8.1.jar log4j-1.2.13.jar poi-3.8-20120326.jar poi-ooxml-3.8-20120326.jar poi-ooxml-schemas-3.8-20120326.jar poi-scratchpad-3.8-20120326.jar stax-api-1.0.1.jar xmlbeans-2.3.0.jar -out:poi.dll 

After the poi.dll is generated i have reffered the dll in my .net solution and
tried the below code to parse a word document(.docx). 

XWPFDocument document = new XWPFDocument(OPCPackage.open(fileName)); 
POIXMLProperties.CoreProperties coreProperties =
document.getProperties().getCoreProperties(); 

It is giving me the below exception. 
 at org.apache.poi.openxml4j.opc.internal.ContentTypeManager..ctor(InputStream
in, OPCPackage pkg) 
   at
org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager..ctor(InputStream
in, OPCPackage pkg) 
   at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl() 
   at org.apache.poi.openxml4j.opc.OPCPackage.getParts() 
   at org.apache.poi.openxml4j.opc.OPCPackage.open(String path, PackageAccess
access) 
   at org.apache.poi.openxml4j.opc.OPCPackage.open(String path) 
   at NPOITestProject.Ole2Document.Ole2DocumentMessageParser.ParseFile(String
fileName) in
D:\Murali\Temp\NPOITestProject\NPOITestProject\Ole2Document\Ole2DocumentMessageParser.cs:line
24 
   at NPOITestProject.Program.Main(String[] args) in
D:\Murali\Temp\NPOITestProject\NPOITestProject\Program.cs:line 44 
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[]
args) 
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args) 
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean ignoreSyncCtx) 
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state) 
   at System.Threading.ThreadHelper.ThreadStart() 

Please explain to me am i doing any thing wrong. Please don't confuse with my
project name i mean Ole2DocumentParser.cs i am simply using a word document
(.docx) for parsing.

Thanks & Regards, 
N.Murali Krishna.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53576] docx file Can't read content types part !

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53576

--- Comment #2 from Murali Krishna <mu...@comakeit.com> ---
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53576] docx file Can't read content types part !

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53576

--- Comment #4 from olivier57 <bu...@noetika.com> ---
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)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53576] docx file Can't read content types part !

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53576

Murali Krishna <mu...@comakeit.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P1
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53576] docx file Can't read content types part !

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53576

--- Comment #3 from Yegor Kozlov <ye...@dinom.ru> ---
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53576] docx file Can't read content types part !

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53576

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Nick Burch <ni...@alfresco.com> ---
Could this be .net related? If you run the same code in pure java, does that
work?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org