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/09/03 13:17:34 UTC
[Bug 53819] New: Can't read xlsx files with error
https://issues.apache.org/bugzilla/show_bug.cgi?id=53819
Priority: P2
Bug ID: 53819
Assignee: dev@poi.apache.org
Summary: Can't read xlsx files with error
Severity: blocker
Classification: Unclassified
Reporter: Anton.Cherepanov@ecm-consulting.ru
Hardware: PC
Status: NEW
Version: 3.8
Component: XSSF
Product: POI
Created attachment 29319
--> https://issues.apache.org/bugzilla/attachment.cgi?id=29319&action=edit
Test file
FileInputStream is = new FileInputStream(fileName);
m_book = WorkbookFactory.create(is);
The simple programe code fales with error:
org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
at
org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62)
at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:403)
at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:408)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:155)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:183)
at
org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:73)
at ru.otr.core.Document.<init>(Document.java:21)
at ru.otr.EnergyLoader.main(EnergyLoader.java:175)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60)
... 7 more
Caused by: org.apache.xmlbeans.XmlException: error: duplicate attribute
'o:relid'
at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3511)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1277)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1264)
at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345)
at org.apache.xmlbeans.XmlObject$Factory.parse(XmlObject.java:688)
at
org.apache.poi.xssf.usermodel.XSSFVMLDrawing.read(XSSFVMLDrawing.java:107)
at
org.apache.poi.xssf.usermodel.XSSFVMLDrawing.<init>(XSSFVMLDrawing.java:102)
... 12 more
Caused by: org.xml.sax.SAXParseException: duplicate attribute 'o:relid'
at
org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1038)
at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:723)
at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3479)
... 18 more
--
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 53819] Can't read xlsx files with error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53819
Yegor Kozlov <ye...@dinom.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
OS| |All
Severity|blocker |normal
--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> ---
The stack trace tells that the file contains invalid xml. I checked the
attached file and it is indeed so:
/xl/drawings/vmlDrawing1.vml contains duplicate attributes which is not
allowed,
have a look at the following fragemnt:
<v:fill o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
o:relid="rId1"
o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
I don't see a problem with POI here. What is the origin of this file? Make sure
that this application writes correct XML.
Yegor
--
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
Re: [Bug 53819] New: Can't read xlsx files with error
Posted by satcal <ko...@gmail.com>.
I have opened and saved the file it started working and am not seeing this
error. poi-3.8-20120326.jar. Any ideas how to resolve the issue.
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Bug-53819-New-Can-t-read-xlsx-files-with-error-tp5710844p5710916.html
Sent from the POI - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: [Bug 53819] New: Can't read xlsx files with error
Posted by satcal <ko...@gmail.com>.
Am tryng to read a file which is created in Windows using POI, am getting
below error. The same code works for the files that I create in mac os env.
I am able to open the file and view it.
Any clues why am i getting below error.
Caused by: java.lang.NullPointerException
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:253)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:159)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:183)
at
org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:73)
at com.fb.service.util.XLSXReader.<init>(XLSXReader.java:40)
at
com.fb.service.impl.EVTransactionDataFileGenerator.getSourceXLSXFileContent(EVTransactionDataFileGenerator.java:185)
at
com.fb.service.impl.EVTransactionDataFileGenerator.getSourceFileContentAsBeans(EVTransactionDataFileGenerator.java:67)
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Bug-53819-New-Can-t-read-xlsx-files-with-error-tp5710844p5710915.html
Sent from the POI - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53819] Can't read xlsx files with error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53819
--- Comment #3 from Yegor Kozlov <ye...@dinom.ru> ---
POI follows the OOXML spec which requires all package parts to be well-formed
XML. If a part is malformed then it is a bug (or a weird feature) of MS Office.
POI works with XML via XmlBeans and its Piccolo parser does not allow duplicate
attributes.
I appears that it is a general behavior:
- Xerces (the standard XML parser from JDK) cannot parse it either
- Chrome browser can't parse it
- msxml.dll (Windows-wide XML parser) cannot parse it.
So I don't see a problem with POI here.
Yegor
(In reply to comment #2)
> Hi. Yegor.
>
> Thank you for your comment.
> This file in attachment is originally created with Microsoft Excel (Ver:
> 14.0.6123.5001 32-bit)
>
> Anton.
>
>
>
> (In reply to comment #1)
> > The stack trace tells that the file contains invalid xml. I checked the
> > attached file and it is indeed so:
> > /xl/drawings/vmlDrawing1.vml contains duplicate attributes which is not
> > allowed,
> > have a look at the following fragemnt:
> >
> > <v:fill o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
> > o:relid="rId1"
> > o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
> > o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
> > o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
> > o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
> >
> >
> > I don't see a problem with POI here. What is the origin of this file? Make
> > sure that this application writes correct XML.
> >
> > Yegor
--
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 53819] Can't read xlsx files with error
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53819
--- Comment #2 from Anton.Cherepanov@ecm-consulting.ru ---
Hi. Yegor.
Thank you for your comment.
This file in attachment is originally created with Microsoft Excel (Ver:
14.0.6123.5001 32-bit)
Anton.
(In reply to comment #1)
> The stack trace tells that the file contains invalid xml. I checked the
> attached file and it is indeed so:
> /xl/drawings/vmlDrawing1.vml contains duplicate attributes which is not
> allowed,
> have a look at the following fragemnt:
>
> <v:fill o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
> o:relid="rId1"
> o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
> o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
> o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
> o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1" o:relid="rId1"
>
>
> I don't see a problem with POI here. What is the origin of this file? Make
> sure that this application writes correct XML.
>
> Yegor
--
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