You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "murali.n" <mu...@comakeit.com> on 2012/07/20 11:22:17 UTC

docx file Can't read content types part !

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.

Thanks & Regards,
N.Murali Krishna.



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/docx-file-Can-t-read-content-types-part-tp5710496.html
Sent from the POI - User mailing list archive at Nabble.com.

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