java – 无法为Spring Web服务找到BeanDefinitionParser元素

我是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_REPO\org\springframework\spring-aop\3.1.1.RELEASE\spring-aop-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-asm\3.1.1.RELEASE\spring-asm-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-beans\3.1.1.RELEASE\spring-beans-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-context\3.1.1.RELEASE\spring-context-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-context-support\3.1.1.RELEASE\spring-context-support-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-core\3.1.1.RELEASE\spring-core-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-expression\3.1.1.RELEASE\spring-expression-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-jdbc\3.1.1.RELEASE\spring-jdbc-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-jms\3.1.1.RELEASE\spring-jms-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-oxm\3.1.1.RELEASE\spring-oxm-3.1.1.RELEASE.jar
M2_REPO\org\springframework\ws\spring-oxm\1.5.10\spring-oxm-1.5.10.jar
M2_REPO\org\springframework\ws\spring-oxm-tiger\1.5.10\spring-oxm-tiger-1.5.10.jar
M2_REPO\org\springframework\security\spring-security-acl\3.1.1.RELEASE\spring-security-acl-3.1.1.RELEASE.jar
M2_REPO\org\springframework\security\spring-security-config\3.1.1.RELEASE\spring-security-config-3.1.1.RELEASE.jar
M2_REPO\org\springframework\security\spring-security-core\3.1.1.RELEASE\spring-security-core-3.1.1.RELEASE.jar
M2_REPO\org\springframework\security\spring-security-remoting\3.1.1.RELEASE\spring-security-remoting-3.1.1.RELEASE.jar
M2_REPO\org\springframework\security\spring-security-taglibs\3.1.1.RELEASE\spring-security-taglibs-3.1.1.RELEASE.jar
M2_REPO\org\springframework\security\spring-security-web\3.1.1.RELEASE\spring-security-web-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-test\3.1.1.RELEASE\spring-test-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-tx\3.1.1.RELEASE\spring-tx-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-web\3.1.1.RELEASE\spring-web-3.1.1.RELEASE.jar
M2_REPO\org\springframework\spring-webmvc\3.1.1.RELEASE\spring-webmvc-3.1.1.RELEASE.jar
M2_REPO\org\springframework\ws\spring-ws-core\2.1.2.RELEASE\spring-ws-core-2.1.2.RELEASE.jar
M2_REPO\org\springframework\ws\spring-ws-core-tiger\1.5.10\spring-ws-core-tiger-1.5.10.jar
M2_REPO\org\springframework\ws\spring-xml\1.5.10\spring-xml-1.5.10.jar

弹簧-WS-servlet.xml中

spring-beans-3.1.xsd
      http://www.springframework.org/schema/web-services
      http://www.springframework.org/schema/web-services/web-services-2.0.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-3.1.xsd">

    

web.xml中

display-name>
        My Webservice Created By Archetype for Spring WS
    display-name>

    dispatcherServletaram>
            aram-name>transformWsdlLocationsaram-name>
            aram-value>truearam-value>
        aram>
    servlet-mapping>
        servlet-mapping>

applicationContext.xml我不确定我是否需要这个……

spring-beans-3.1.xsd
              http://www.springframework.org/schema/context
              http://www.springframework.org/schema/context/spring-context-3.1.xsd">

    fig />

每当它读取一个元素时,就会在spring-ws-servlet.xml中抛出该错误.就像我说的,我是Spring网络服务的新手,并且认识到我的设置可能存在明显的缺陷,并且非常感谢任何帮助.谢谢!

最佳答案
解决了.显然我的一个依赖项引入了不同版本的spring-ws,即使它没有列在我引用的库下.我实际上最终不需要整个依赖,所以我只是删除它,现在我没有得到任何错误.

相关文章

这篇文章主要介绍了spring的事务传播属性REQUIRED_NESTED的原...
今天小编给大家分享的是一文解析spring中事务的传播机制,相...
这篇文章主要介绍了SpringCloudAlibaba和SpringCloud有什么区...
本篇文章和大家了解一下SpringCloud整合XXL-Job的几个步骤。...
本篇文章和大家了解一下Spring延迟初始化会遇到什么问题。有...
这篇文章主要介绍了怎么使用Spring提供的不同缓存注解实现缓...