Summary: | TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found | ||
---|---|---|---|
Product: | POI | Reporter: | Hector Fontanez <hector.j.fontanez> |
Component: | POI Overall | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WORKSFORME | ||
Severity: | trivial | ||
Priority: | P2 | ||
Version: | 3.17-FINAL | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All |
Description
Hector Fontanez
2015-04-28 16:32:47 UTC
Current versions of Apache POI requires Java 6, so I'm not sure this applies/matters to us? (There are no org.apache.xalan references to be found in the current codebase either) (In reply to Nick Burch from comment #1) > Current versions of Apache POI requires Java 6, so I'm not sure this > applies/matters to us? > > (There are no org.apache.xalan references to be found in the current > codebase either) Precisely for that reason the documentation must be updated. Since Java SE 5.0, the "org.apache" packages have been relocated. Therefore, you must download Xalan from Apache. Because that change in Java, this is an external dependency of POI products that depend on code in that package. I can't find any references to org.apache.xalan in our codebase or documentation, sorry. Any chance you could point me to the place where they are, so we can get them updated? Ideally, if you could also provide a unit test (that fails on trunk without the fix) to highlight the problem, that'd be handy too! (In reply to Nick Burch from comment #3) > I can't find any references to org.apache.xalan in our codebase or > documentation, sorry. Any chance you could point me to the place where they > are, so we can get them updated? > > Ideally, if you could also provide a unit test (that fails on trunk without > the fix) to highlight the problem, that'd be handy too! The following code works with xalan.jar in the classpath, but throws an exception without it: Workbook wb = new XSSFWorkbook(); FileOutputStream fileOut = new FileOutputStream("workbook.xlsx"); wb.write(fileOut); // Fails here (uncaught exception) fileOut.close(); Using HSSFWorkbook works with our without Xalan because they don't use OOXML. My development environment uses Java SE 6 and was failing on the call to the write method until I downloaded (as recommended by Java) Xalan with all the additional JARs (serializer.jar, xercesImpl.jar, xml-apis.jar). Removing the xalan.jar (and leaving the other updated ones) results in following error: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal. You haven't said what version of Apache POI you are using. As long as it's something recent (eg 3.11 or 3.12 beta 1), no additional jars are required beyond those shipped in the binary packages. The code you have given in your snippet works just fine for me on trunk, with no additional jars needed, so my hunch is that you're using an old version of POI, either knowingly or by accident (In reply to Nick Burch from comment #5) > You haven't said what version of Apache POI you are using. As long as it's > something recent (eg 3.11 or 3.12 beta 1), no additional jars are required > beyond those shipped in the binary packages. > > The code you have given in your snippet works just fine for me on trunk, > with no additional jars needed, so my hunch is that you're using an old > version of POI, either knowingly or by accident I am using Apache POI 3.11. I updated the bug information. When I upgraded to 3.11, I added the following JARs and removed the old ones from classpath: poi-3.11-20141221.jar poi-ooxml-3.11-20141221.jar poi-ooxml-schemas-3.11-20141221.jar xmlbeans-2.6.0.jar In my particular case, when I wrote using HSSF, it worked fine. However, after changing to XSSF, I could not create even a blank file without an error. Once I added the JARs I mentioned before, the problem went away. Reading operations were unaffected by this. 1. Can you run the following to see where the XSSFWorkbook is loaded, just to make sure that there is not a version of POI loaded from somewhere: System.out.println(Thread.currentThread().getContextClassLoader().getResource(XSSFWorkbook.class.getName().replace(".", "/") + ".class")); 2. Another thing that could happen is that you have some other jar-file in the classpath which tries to pull in Xalan/Xerces and via the service-files in META-INF "install" Xerces as default XML Parser. 3. Also which exact JDK is this? If it is the IBM JDK, I would strongly suggest to upgrade to 1.7 as 1.6 has various problems, see also the FAQ at http://poi.apache.org/faq.html#faq-N1017E => Can you try this in a newly created project which only has POI? This way we eliminate the first two possible causes? No response for a long time, thus closing this bug for now, please reopen with more information if this is still a problem for you. I am using following versions to make XSSF Workbook poi-3.17.jar poi-ooxml-3.17.jar poi-ooxml-schemas-3.17.jar xmlbeans-2.6.0.jar commons-codec-1.10.jar commons-collections4-4.1.jar curvesapi-1.04.jar stax-api-1.0.1.jar When i run the code , in the workbook.write() method it is giving error [Fail to save: an error occurs while saving the package : The part /docProps/core.xml failed to be saved in the stream with marshaller org.apache.poi.openxml4j.opc.internal.marshallers.ZipPackagePropertiesMarshaller@1d386dd] , even the excel generated is of unsupported format(Corrupted) But, when i add xalan-2.6.0.jar , this works perfectly fine , workbook write method is working properly and excel generated is as per expectation. But I don't need xalan-2.6.0 or any of it version. I want to run my code only with above mentioned jars. Please do not reopen any bug where you did not contribute before and which is not related to your problem. Please try with the latest version of POI (4.0.1 currently) and create a new bug entry with a sample file and some code that reproduces the problem so we can properly analyze. |