You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicemix.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2018/12/20 01:10:00 UTC
[jira] [Commented] (SM-3914) NoSuchMethodError with POI 4 bundle
[ https://issues.apache.org/jira/browse/SM-3914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16725490#comment-16725490 ]
Freeman Fang commented on SM-3914:
----------------------------------
I checked poi 3.17, it need to use setEntityExpansionLimit method from XmlOptions by reflection
{code}
find . -name "*.java"|xargs grep setEntityExpansionLimit
./src/ooxml/java/org/apache/poi/util/DocumentHelper.java: Method setLimit = mgr.getClass().getMethod("setEntityExpansionLimit", Integer.TYPE);
./src/ooxml/java/org/apache/poi/util/SAXHelper.java: Method setLimit = mgr.getClass().getMethod("setEntityExpansionLimit", Integer.TYPE);
{code}
And this method was introduced into xmlbeans since 3.0.1 by [this commit|https://github.com/apache/xmlbeans/commit/ba1192dc364695dc5265a39893eb5daac820b188]
So we need upgrade to xmlbeans 3.0.1 for this poi bundle
> NoSuchMethodError with POI 4 bundle
> -----------------------------------
>
> Key: SM-3914
> URL: https://issues.apache.org/jira/browse/SM-3914
> Project: ServiceMix
> Issue Type: Bug
> Components: bundles
> Affects Versions: bundles-2018.11
> Reporter: Arnaud MERGEY
> Assignee: Freeman Fang
> Priority: Major
>
> It seems there is an issue with xmlbean version packaged inside POI bundle. Trying to load an excel file with POI I can see following exception:
> Caused by: org.apache.poi.ooxml.POIXMLException: org.apache.xmlbeans.XmlOptions.setEntityExpansionLimit(I)Lorg/apache/xmlbeans/XmlOptions;
> at org.apache.poi.ooxml.POIXMLFactory.createDocumentPart(POIXMLFactory.java:66)
> at org.apache.poi.ooxml.POIXMLDocumentPart.read(POIXMLDocumentPart.java:648)
> at org.apache.poi.ooxml.POIXMLDocument.load(POIXMLDocument.java:180)
> at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:286)
> at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:307)
> at com.semarchy.jdbc.excel.ExcelDriver.loadWorkBook(ExcelDriver.java:147)
> ... 7 more
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:56)
> at org.apache.poi.ooxml.POIXMLFactory.createDocumentPart(POIXMLFactory.java:63)
> ... 12 more
>
> Caused by: java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setEntityExpansionLimit(I)Lorg/apache/xmlbeans/XmlOptions;
> at org.apache.poi.ooxml.POIXMLTypeLoader.<clinit>(POIXMLTypeLoader.java:43)
> at org.apache.poi.xssf.model.ThemesTable.<init>(ThemesTable.java:86)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)