错误信息如下:
<Feb 22, 2012 2:42:28 AM EST> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: fAugmentations.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: fAugmentations
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:403)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
Truncated. see log file for complete stacktrace
java.lang.NoSuchFieldError: fAugmentations
at org.apache.xerces.util.XMLAttributesMMImpl.addAttribute(XMLAttributesMMImpl.java:158)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerMMImpl.scanStartElement(XMLNSDocumentScannerMMImpl.java:316)
Truncated. see log file for complete stacktrace
>
<Feb 22, 2012 2:42:28 AM EST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application 'pnlWebApp'.
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1373)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:468)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
Truncated. see log file for complete stacktrace
java.lang.NoSuchFieldError: fAugmentations
at org.apache.xerces.util.XMLAttributesMMImpl.addAttribute(XMLAttributesMMImpl.java:158)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerMMImpl.scanStartElement(XMLNSDocumentScannerMMImpl.java:316)
Truncated. see log file for complete stacktrace
>
解决方法:
将xercesImpl.jar和xercesPatch.jar包添加到weblogic的classpath中
分析:
初步分析的问题原因是,weblogic本身引用的第三方jar包中含有xerces jar包,导致覆盖了webapp中的xerces jar包。