Hello Fanning - Here is the java program & excel file for reproduction.

With xmlbeans 3.0.0 the program fails with similar exception while it 
outputs excel values with xmlbeans 2.6.0.




Steps to reproduce
1) export CLASSPATH pointing to the following jars ( could not attach due 
to size restrictions)
poi-3.14.jar
poi-ooxml-3.14.jar
poi-ooxml-schemas-3.14.jar
xmlbeans-3.0.0.jar
2) compile the java program
3) run the java class
You will find similar exception whereas when  xmlbeans2.6.0 is used it 
outputs successfully. 

A bug XMLBEANS-571 is already raised.

---
Thanks
Sateesh 



From:   "PJ Fanning" <fannin...@yahoo.com.INVALID>
To:     "POI Users List" <user@poi.apache.org>
Date:   23-09-2021 18:42
Subject:        [EXTERNAL] Re: Excel cell with note failing on xmlbeans 
3.0.0



I'm afraid that we can't help if you don't supply a xlsx file or 
reproduction steps. Use stackoverflow if you want to go this route.

Could you start by unzipping the xlsx file and checking the xml files 
inside it?

The exception you are getting - org.xml.sax.SAXParseException: Content is 
not allowed in
trailing section.

This is usually caused by someone leaving random text in the XML after the 
final end tag.




On Thursday 23 September 2021, 13:59:04 IST, Sateesh K Kolusu 
<sateesh.kol...@in.ibm.com> wrote: 





Thank you Fanning. But how did adding a excel feature ie., note to a cell 
made the file invalid ?  I am not adding anything that is outside Excel 
features. How did it affect the xml file internally?

---
Thanks
Sateesh 



From:  "PJ Fanning" <fannin...@yahoo.com.INVALID>
To:    "POI Users List" <user@poi.apache.org>
Date:  23-09-2021 16:21
Subject:        [EXTERNAL] Re: Excel cell with note failing on xmlbeans 
3.0.0




Hi Sateesh,
POI is built and tested with specific XMLBeans releases. XMLBeans 3.0.0 is 

a major upgrade and is not meant to be compatible with XMLBeans 2.6.0. The 

versioning scheme is based on 
https://semver.org/ 
 

You should be able to use newer XMLBeans 2.x.y versions.

XMLBeans 3.0.0 doesn't have many changes (from 2.6.0). See 
https://xmlbeans.apache.org/history.html 
 


I think you are affected by the removal of support for the Piccolo parser 
- I'm assuming that it was more tolerant of invalid XML in the xlsx file 
(xlsx files are just zip files).

Xerces parser is what you have in your stack trace.

It might be a good idea generally to upgrade POI - POI 3.14 is very old.






On Thursday 23 September 2021, 11:40:30 IST, Sateesh K Kolusu 
<sateesh.kol...@in.ibm.com> wrote: 





Hi - I have an Excel file cell with note processing successfully with POI 
3.14 + xmlbeans 2.6.0. 
But when we moved to xmlbeans 3.0.0 it fails with following exception. If 
I delete the note in the  Excel file it processes successfully with 3.0.0.

Source_File,0: org.apache.poi.POIXMLException: 
java.lang.reflect.InvocationTargetException
        at 
org.apache.poi.POIXMLFactory.createDocumentPart(POIXMLFactory.java:65)
        at 
org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:601)
        at 
org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:613)
        at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:174)
        at 
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:249)
        .......
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:83)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
        at 
org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:56)
        at 
org.apache.poi.POIXMLFactory.createDocumentPart(POIXMLFactory.java:62)
        ... 12 more
Caused by: org.apache.xmlbeans.XmlException: error: Content is not allowed 


in trailing section.
        at 
org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3439)
        at 
org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1271)
        at 
org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1258)
        at 
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345)
        at org.apache.xmlbeans.XmlObject$Factory.parse(XmlObject.java:747)
        at 
org.apache.poi.xssf.usermodel.XSSFVMLDrawing.read(XSSFVMLDrawing.java:128)
        at 
org.apache.poi.xssf.usermodel.XSSFVMLDrawing.<init>(XSSFVMLDrawing.java:116)
        ... 18 more
Caused by: org.xml.sax.SAXParseException: Content is not allowed in 
trailing section.
        at 
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 


Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown 
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
Source)
        at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown 
Source)
        at 
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown
 


Source)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 


Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown 
Source)
        at 
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at 
org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3413)
        ... 24 more

---
Thanks
Sateesh



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







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





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

Reply via email to