javaspringapache-cameltomcat10

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


We have this error after migrating to jdk17 and Camel 4 : Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/cxf]

My file xml concerned is :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xmlns:cxf="http://camel.apache.org/schema/cxf"
       xmlns:soap="http://cxf.apache.org/bindings/soap"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
            http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
            http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
            http://cxf.apache.org/bindings/soap 
            https://cxf.apache.org/bindings/schemas/configuration/soap.xsd
            ">
   <!-- soap end point -->    
    <cxf:cxfEndpoint id="interfaceSoap"
            address="${path}" 
            serviceClass="myClass">
          <cxf:properties>
                 <entry key="schema-validation-enabled" value="true" />
          </cxf:properties>
          <cxf:inInterceptors>
             <bean class="myInInterceptor"/>
          </cxf:inInterceptors>
          <cxf:outInterceptors>
             <bean class="myOutInterceptor"/>
          </cxf:outInterceptors>
    </cxf:cxfEndpoint>

and I have already libs camel cxf in my pom (camel 4.0.2) :

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-jms</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-xml</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-core</artifactId>
    </dependency>       

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-jaxb</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-support</artifactId>
    </dependency>       
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-cxf-rest</artifactId>
    </dependency>   
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-cxf-common</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-soap</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-cxf-soap</artifactId>
    </dependency>
    <dependency>
           <groupId>org.apache.cxf</groupId>
           <artifactId>cxf-rt-frontend-jaxws</artifactId>
    </dependency>
    
    
    <dependency>
        <groupId>org.opengis.cite.xerces</groupId>
        <artifactId>xercesImpl-xsd11</artifactId>
        <version>2.12-beta-r1667115</version>
    </dependency>
    
    <!-- Utils -->
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
    </dependency>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
    </dependency>

Could you give us advice? which lib is missing ?


Solution

  • I resolved the problem with this :

    http://camel.apache.org/schema/cxf/jaxws http://camel.apache.org/schema/cxf/jaxws/camel-cxf.xsd

    and with adding this lib to pom : camel-cxf-spring-rest, camel-cxf-spring-soap

    https://camel.apache.org/manual/camel-3x-upgrade-guide-3_18.html#_camel_cxf