Getting error “Provider com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl not found” in unit test but not in main program

。_饼干妹妹 提交于 2019-12-04 03:47:15

I ran into the same issue just recently while testing the same library. I found that including a reference to IKVM.OpenJDK.XML.Parse.dll solved the issue.

I hit a similar problem.

It seems the com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl class is not loaded and so the factory can not create it. Adding this line in before the call to the factory forces the assembly to load, and then the factory can see it and everything works as expected...

com.sun.org.apache.xerces.@internal.jaxp.SAXParserFactoryImpl s =   new  com.sun.org.apache.xerces.@internal.jaxp.SAXParserFactoryImpl();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!