I’m having some trouble trying to include Apache POI poi-ooxml library to my project. I’m using Maven and the following dependency:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.8</version>
</dependency>
But after doing this I’m not able to start my Spring MVC app again, Here is the stacktrace:
Exception created : org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/context/applicationContext.xml]; nested exception is javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.DocumentBuilderFactory cannot be found
So, what I understand is that poi-ooxml is including another xml parser that override the default Java VM defaut one that is used by Spring to read its xml configuration file.
If I exclude the 2 following libs:
- xmlbeans
- xml-apis
All is working fine (I’m able to start my Spring app) but of course Apache POI is no longer working as he’s missing these 2 required libs…
Any advice will be greatly appreciated 😉
Thanks
I’ve had similiar problem after adding poi-ooxml to my existing groovy application. I’ve added xercesImpl to project, and it seems to be working. Maybe you should give it a try.