javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found

Hi,

I am using IntelliJ IDEA 11.1 and groovy. I use apache POI for reading data from a MS Excel file. When I use @Grab annotations to specify the depenency on POI I get the following error when I run the script. The same script runs fine from command line.

Caught: javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found
javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found
 at org.apache.ivy.core.settings.XmlSettingsParser.doParse(XmlSettingsParser.java:160)
 at org.apache.ivy.core.settings.XmlSettingsParser.parse(XmlSettingsParser.java:150)
 at org.apache.ivy.core.settings.IvySettings.load(IvySettings.java:412)
 at org.apache.ivy.core.settings.IvySettings$load.call(Unknown Source)
 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)



When I put the cursor or @Grab and hit Alt+Enter, it downloads the dependencies. But I get this error when I execute the script.


I have attaced a sample code.

Thanks
Anand

Attachment(s):
TestGrab.groovy.zip
2 comments
Comment actions Permalink

I am not able to resolve this. Any ideas/suggestions please.

Thanks
Anand

0
Comment actions Permalink

IntelliJ IDEA 2019.2.3 confirm same issue - debugging and command line were working fine until I pressed Alt+Enter on one of imports installed by @Grapes. Now IDE fails to run/debug while command line still works fine.

I have a bit different call-stack here, it's thrown by ivy-2.4.0.jar from my groovy folder (I tested 2.4.4 and 2.5.8):

Caught: javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found
javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found
at org.apache.ivy.core.settings.XmlSettingsParser.doParse(XmlSettingsParser.java:160)
at org.apache.ivy.core.settings.XmlSettingsParser.parse(XmlSettingsParser.java:150)
at org.apache.ivy.core.settings.IvySettings.load(IvySettings.java:393)
at org.apache.ivy.core.settings.IvySettings$load.call(Unknown Source)

After poking around I found this reply (because I also have some hibernate imports...). So, simply deleted "xml-apis" from ~/.groovy/grapes or add

@GrabExclude('xml-apis:xml-apis')

Works for me, but there is obviously a bug somewhere that causes this...

0

Please sign in to leave a comment.