我是Spring Web服务的新手,我一直收到这个错误:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [annotation-driven]
Offending resource: ServletContext resource [/WEB-INF/spring-ws-servlet.xml]
经过一番挖掘,看起来我很可能在我的架构和罐子之间存在版本不匹配但是我没有看到哪里(我正在为v3.1拍摄).
这是我库中的每个Spring jar:
M2_REPOorgspringframeworkspring-aop3.1.1.RELEASEspring-aop-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-asm3.1.1.RELEASEspring-asm-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-beans3.1.1.RELEASEspring-beans-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-context3.1.1.RELEASEspring-context-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-context-support3.1.1.RELEASEspring-context-support-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-core3.1.1.RELEASEspring-core-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-expression3.1.1.RELEASEspring-expression-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-jdbc3.1.1.RELEASEspring-jdbc-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-jms3.1.1.RELEASEspring-jms-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-oxm3.1.1.RELEASEspring-oxm-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkwsspring-oxm1.5.10spring-oxm-1.5.10.jar
M2_REPOorgspringframeworkwsspring-oxm-tiger1.5.10spring-oxm-tiger-1.5.10.jar
M2_REPOorgspringframeworksecurityspring-security-acl3.1.1.RELEASEspring-security-acl-3.1.1.RELEASE.jar
M2_REPOorgspringframeworksecurityspring-security-config3.1.1.RELEASEspring-security-config-3.1.1.RELEASE.jar
M2_REPOorgspringframeworksecurityspring-security-core3.1.1.RELEASEspring-security-core-3.1.1.RELEASE.jar
M2_REPOorgspringframeworksecurityspring-security-remoting3.1.1.RELEASEspring-security-remoting-3.1.1.RELEASE.jar
M2_REPOorgspringframeworksecurityspring-security-taglibs3.1.1.RELEASEspring-security-taglibs-3.1.1.RELEASE.jar
M2_REPOorgspringframeworksecurityspring-security-web3.1.1.RELEASEspring-security-web-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-test3.1.1.RELEASEspring-test-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-tx3.1.1.RELEASEspring-tx-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-web3.1.1.RELEASEspring-web-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkspring-webmvc3.1.1.RELEASEspring-webmvc-3.1.1.RELEASE.jar
M2_REPOorgspringframeworkwsspring-ws-core2.1.2.RELEASEspring-ws-core-2.1.2.RELEASE.jar
M2_REPOorgspringframeworkwsspring-ws-core-tiger1.5.10spring-ws-core-tiger-1.5.10.jar
M2_REPOorgspringframeworkwsspring-xml1.5.10spring-xml-1.5.10.jar
弹簧-WS-servlet.xml中
web.xml中
applicationContext.xml我不确定我是否需要这个……
每当它读取一个元素时,就会在spring-ws-servlet.xml中抛出该错误.就像我说的,我是Spring网络服务的新手,并且认识到我的设置可能存在明显的缺陷,并且非常感谢任何帮助.谢谢!
解决了.显然我的一个依赖项引入了不同版本的spring-ws,即使它没有列在我引用的库下.我实际上最终不需要整个依赖,所以我只是删除它,现在我没有得到任何错误.