JAX-WS war deployment error in Tomcat: cannot resolve name 'cxf- beans: beanAttributes'

I am trying to deploy a JAX-WS web service on Tomcat. I create a war in Eclipse. The error that I run Tomcat is -

SEVERE: Exception sending context initialized event to listener instance of class 
org.springframework.web.context.ContextLoaderListener 
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 

Configuration problem: 
Failed to import bean definitions from relative location [ws/ws-context.xml]
Offending resource: ServletContext resource [/WEB-INF/spring/application-context.xml]; 

nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: ...  
nested exception is org.xml.sax.SAXParseException: 
src-resolve: Cannot resolve the name 'cxf-beans:beanAttributes' to a(n) 'attribute group' 
component.

XML infringing file

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/util 
        http://www.springframework.org/schema/util/spring-util-3.0.xsd
        http://cxf.apache.org/jaxrs 
        http://cxf.apache.org/schemas/jaxrs.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-xml.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

    <jaxrs:server id="restContainer" address="/">
        <jaxrs:serviceBeans>
            <ref bean="ABC" />
        </jaxrs:serviceBeans>
    </jaxrs:server>

</beans>

Has anyone seen this error before, please?

+4
source share

Source: https://habr.com/ru/post/1542714/


All Articles