微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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,即使它没有列在我引用的库下.我实际上最终不需要整个依赖,所以我只是删除它,现在我没有得到任何错误.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐