My problem is similar to this question but I am trying this on intellij Idea Ultimate (2018.1.3) instead of Eclipse and answers suggested there are not working for me.
My project uses ivy for dependency management and I have xerces 2.8 and 2.11 in my classpath due to transitive dependencies. I am using jdk8 to build the project and when I try to deply my web application in WebLogic 12.1.3 I am getting below exception,
aused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
at org.apache.openjpa.lib.xml.XMLFactory.getDOMParser(XMLFactory.java:107)
at org.apache.openjpa.jdbc.sql.SQLErrorCodeReader.parse(SQLErrorCodeReader.java:108)
at org.apache.openjpa.jdbc.sql.DBDictionary.endConfiguration(DBDictionary.java:4096)
at org.apache.openjpa.jdbc.sql.OracleDictionary.endConfiguration(OracleDictionary.java:170)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:505)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:430)
at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:199)
at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:66)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:530)
at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1250)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:505)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:430)
at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:103)
at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:843)
at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:834)
at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:292)
at kodo.kernel.KodoBroker.initialize(KodoBroker.java:32)
at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:216)
at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:190)
... 44 common frames omitted
I have tried adding below parameters in my classpath server starts successfully but our code needs Xerces versions of these file so all my APIs fail.
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactor
This is working without any change in eclipse I need to get it working on intellij please help.