Hi,

I get the following, which looks like the change to remove dom4j is
not fully working yet for some versions of Xerces XML Parser:

java.lang.AbstractMethodError:
javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
    at 
org.apache.poi.util.DocumentHelper.trySetSAXFeature(DocumentHelper.java:62)
    at org.apache.poi.util.DocumentHelper.<clinit>(DocumentHelper.java:56)
    at 
org.apache.poi.openxml4j.opc.internal.marshallers.ZipPartMarshaller.marshallRelationshipPart(ZipPartMarshaller.java:120)
    at org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:464)
    at org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1425)
    at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:201)
    at 
com.xxx.diagnostics.report.excel.ExcelRenderer.reportDashboard(ExcelReportRenderer.java:99)
    at 
com.xxx.diagnostics.report.excel.ExcelRendererTest.testReportDashboardWithTooManyTableRowsXLSX(ExcelReportRendererTest.java:2268)

This is a larger set of tests with some POI-related tests, due to
other dependencies an older version of Xerces XML Parser is pulled:

documentBuilderFactory is a
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl and not a
javax.xml.parsers.DocumentBuilderFactory which is provided with Java
itself.

Test-Case is simply:

    @Test
    public void testCrash() throws IOException {
        System.out.println("Java: " + System.getProperty("java.version"));

        try (Workbook wb = new XSSFWorkbook()) {
            FileOutputStream out = new FileOutputStream(new
File("C:\\temp\\test.xlsx"));
            try {
                wb.write(out);
            } finally {
                out.close();
            }
        }
    }


At least xerces-2.6.1 is not providing the "setFeature()" method,
xerces-2.11 and 2.9.1 seem to have it, I did not check intermediate
versions.

I vote that we avoid this crash by either also catching the
AbstractMethodError or not calling that method on older versions of
Xerces that do not yet have "setFeature". Customers will run POI in
all sorts of environments and thus it is likely that older versions of
Xerces are still present in a number of them.

Thus -1 from me unless it can be explained as being a local problem in
my environment.

Dominik.

On Sun, Aug 17, 2014 at 11:45 PM, Andreas Beeker <[email protected]> wrote:
> +1 from my side
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to