Hi! At work we were making use of POI and when we updated the version to 3.11 we suffered some incompatibility issues. We have IBM WAS 7 servers and are unable to migrate (easily to WAS 8.5.5). IBMs JDK 1.6 implementation doesn't include all stax related classes and methods. Namely, we had an issue with POI class PackagePropertiesMarshaller.java, where it includes: static { XMLEventFactory f = XMLEventFactory.newFactory(); namespaceDC = f.createNamespace("dc", "http://purl.org/dc/elements/1.1/"); namespaceCoreProperties = f.createNamespace("cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties"); namespaceDcTerms = f.createNamespace("dcterms", "http://purl.org/dc/terms/"); namespaceXSI = f.createNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"); } IBM implementation has newInstance(), but not newFactory (in Oracle's JVM, it was introduced in 1.6 fix 18) We have had to change PackagePropertiesMarshaller.java to use newInstance, so it could keep on running in our servers: static { XMLEventFactory f = XMLEventFactory.newInstance(); namespaceDC = f.createNamespace("dc", "http://purl.org/dc/elements/1.1/"); namespaceCoreProperties = f.createNamespace("cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties"); namespaceDcTerms = f.createNamespace("dcterms", "http://purl.org/dc/terms/"); namespaceXSI = f.createNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"); } As the resultin execution is the same, to mantain compatibility with the broadest range of servers, I'd suggest to change this particular call.
Do all unit tests still pass on an Orcale JVM after the change? (We don't want to make the change and break things on other JVMs!)
I haven't been able to test it, but according to API spec, it shouldn't have any effect. newInstance existed since first version of stax api, while newFactoy was introduced in Oracle 1.6.0.18 'to mantain api consistency', but both have the same functionality. http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLEventFactory.html#newInstance(java.lang.String, java.lang.ClassLoader) http://upstream.rosalinux.ru/java/compat_reports/jdk/1.6.0.17_to_1.6.0.18/bin_compat_report.html#Added Also as a reference, other users with the same issue: http://mail-archives.apache.org/mod_mbox/poi-dev/201501.mbox/%3CFB8F943CCE197F4A8C65545509CA885B0180A24F7FD8@MSGRTPCCRF2WIN.DMN1.FMR.COM%3E
Changed in r1661903, thanks for your investigations and help on this!