sslcontext

The matching wildcard is strict, but no declaration can be found for element 'http:conduit'


Basically I want to set useHttpsURLConnectionDefaultSslSocketFactory(tlsClientParameters) to true to use HttpsURLConnection.setDefaultSSLSocketFactory to pass the custom truststore manager.

For this reason, I'm having configuration in spring context file, below is the configuration: Its showing error in the file itself on the the tag (http:conduit)

beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns:context="http://www.springframework.org/schema/context"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:task="http://www.springframework.org/schema/task"
             xmlns:cxf="http://cxf.apache.org/core"
             xmlns:http="http://cxf.apache.org/transports/http/configuration"
             xmlns:sec="http://cxf.apache.org/configuration/security"
             xmlns:jaxws="http://cxf.apache.org/jaxws"
             xmlns:jaxrs="http://cxf.apache.org/jaxrs"
             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                                 http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
                                 http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
                                 http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
                                 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
                                 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/wsdl/http-conf.xsd
                                 http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxs.xsd
                                 http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jars.xsd">

    <http:conduit name="*.http-conduit">
        <http:tlsClientParameters useHttpsURLConnectionDefaultSslSocketFactory="true" />
    </http:conduit>

</beans:beans>

But on wildfly-24 restart, I'm getting the above error.

Below are the dependencies in the ant file:

<dependency org="org.apache.cxf" name="cxf-core" rev="${cxf.version}"><artifact name="cxf-core" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-bindings-soap" rev="${cxf.version}"><artifact name="cxf-rt-bindings-soap" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-databinding-jaxb" rev="${cxf.version}"><artifact name="cxf-rt-databinding-jaxb" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-frontend-jaxws" rev="${cxf.version}"><artifact name="cxf-rt-frontend-jaxws" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-frontend-jaxrs" rev="${cxf.version}"><artifact name="cxf-rt-frontend-jaxrs" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-frontend-simple" rev="${cxf.version}"><artifact name="cxf-rt-frontend-simple" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-transports-http" rev="${cxf.version}"><artifact name="cxf-rt-transports-http" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-wsdl" rev="${cxf.version}"><artifact name="cxf-rt-wsdl" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-ws-security" rev="${cxf.version}"><artifact name="cxf-rt-ws-security" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-security" rev="${cxf.version}"><artifact name="cxf-rt-security" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-tools-wsdlto-core" rev="${cxf.version}"><artifact name="cxf-tools-wsdlto-core" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-tools-wsdlto-frontend-jaxws" rev="${cxf.version}"><artifact name="cxf-tools-wsdlto-frontend-jaxws" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-bindings-xml" rev="${cxf.version}"><artifact name="cxf-tools-wsdlto-core" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-databinding-aegis" rev="${cxf.version}"><artifact name="cxf-rt-databinding-aegis" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-management" rev="${cxf.version}"><artifact name="cxf-rt-management" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-transports-local" rev="${cxf.version}"><artifact name="cxf-rt-transports-local" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-ws-addr" rev="${cxf.version}"><artifact name="cxf-rt-ws-addr" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-ws-rm" rev="${cxf.version}"><artifact name="cxf-rt-ws-rm" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-tools-common" rev="${cxf.version}"><artifact name="cxf-tools-common" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-databinding-jibx" rev="${cxf-jibx.version}"><artifact name="cxf-rt-databinding-jibx" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-rs-client" rev="${cxf.version}"><artifact name="cxf-rt-rs-client" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-rs-extension-providers" rev="${cxf.version}"><artifact name="cxf-rt-rs-extension-providers" ext="jar"/></dependency>
        <dependency org="org.apache.cxf" name="cxf-rt-ws-policy" rev="${cxf.version}"><artifact name="cxf-rt-ws-policy" ext="jar"/></dependency>

Solution

  • What I figure out to resolve it as mentioned below:

    1. Need to add cxf library in the ear(classpath),
    2. Need to add below configuration in the spring context file with the name space:
    <http:conduit name="*.http-conduit">
            <http:tlsClientParameters useHttpsURLConnectionDefaultSslSocketFactory="true" />
    </http:conduit>
    

    and don't forget to add below line in the same spring context file (this is what I was missing):

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