在main方法中启动spring报异常
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
缺少xercesImpl.jar这个包
下载地址:
http://archive.apache.org/dist/xml/xerces-j/
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
分享到:
相关推荐
如果找不到 `org.apache.xerces.jaxp.DocumentBuilderFactoryImpl` 这个提供商,那么会抛出这个异常,这意味着 Xerces 解析器可能没有正确地添加到类路径(classpath)或者系统没有配置正确的服务提供者。...
- **配置解析器**:在Java代码中,可以通过`org.apache.xerces.jaxp.DocumentBuilderFactoryImpl`或`org.apache.xerces.jaxp.SAXParserFactoryImpl`来创建并配置解析器。 - **错误处理**:解析过程中如果遇到错误,...
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"); System.setProperty("javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp....
factory.setFeature("http://apache.org/xml/features/nonvalidating/schema", true); factory.setClass(DocumentBuilderFactoryImpl.class); DocumentBuilder builder = factory.newDocumentBuilder(); ...
ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl** 当使用Oracle OC4J时,可能会遇到此类错误。解决方案通常是更换XML解析器,例如用Xerces替换Oracle自带的解析器。 **2. HTTP 500访问...
- `DocumentBuilderFactory`类:用于创建XML解析器工厂实例,它支持SPI机制,可以通过`newInstance()`方法指定具体的实现类,如`org.apache.xerces.jaxp.DocumentBuilderFactoryImpl`。 了解Java类加载器的工作原理...
- `com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl` 和 `com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl`:这是Java默认的XML解析器,基于Xerces实现。 - `org.w3c.dom` 和 `...
特别感兴趣的是, index.cfm页面展示了JavaLoader方法.switchThreadContextClassLoader() ,这是AntiSamy 1.5.7所必需的,以避免出现类装入错误,例如: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl无法...