Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxrs]

匿名 (未验证) 提交于 2019-12-03 01:49:02

问题:

I am trying to integrate Apache CXF with Spring to create a RESTful webservices. But while deploying the application I am getting the following exception.

SEVERE: Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxrs] Offending resource: ServletContext resource [/WEB-INF/beans.xml] 

This is my beans.xml

and my pom.xml is

4.0.0com.maventestLabwar1.0-SNAPSHOTLab Maven Webapphttp://maven.apache.org1.63.0.3.RELEASE4.52.5.02.4.0junitjunit3.8.1testorg.apache.cxfcxf-rt-frontend-jaxws${cxf.version}org.apache.cxfcxf-rt-transports-http${cxf.version}javax.ws.rsjsr311-api1.1org.springframeworkorg.springframework.web${spring.version}org.springframeworkorg.springframework.web.servlet${spring.version}org.apache.xmlbeansxmlbeans2.4.0org.codehaus.jacksonjackson-mapper-asl1.9.2net.sf.kxmlkxml22.2.2Labmaven-compiler-plugin1.61.6org.mortbay.jettymaven-jetty-plugin6.1.2110src/main/webapp/WEB-INFsrc/main/webapp/WEB-INF/web.xml

I am not sure what jar or configuration I am missing.

I have added cxf-rt-frontend-jaxrs jar but still getting same exception

回答1:

As per this guide, you may want to try adding the following dependency in your pom.

org.apache.cxfcxf-rt-frontend-jaxrs${cxf.version}


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!