Skip to content

CXF integration broken in Spring 3 RC2 [SPR-6412] #11078

@spring-projects-issues

Description

@spring-projects-issues

David Ward opened SPR-6412 and commented

At Alfresco we found that the integration with Apache CXF 2.2.2 that worked with previous snapshots of Spring 3 does not work with RC2.

We are using a set up more or less as documented here

http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html

It appears to be due to the processing of the @PostConstruct annotation on org.apache.cxf.binding.AbstractBindingFactory or org.apache.cxf.binding.soap.SoapBindingFactory. SoapBindingFactory is declared as follows in cxf-extension-soap.xml. As you can see, it has a lazy-init.

<bean id="org.apache.cxf.binding.soap.SoapBindingFactory"
  class="org.apache.cxf.binding.soap.SoapBindingFactory" lazy-init="true">
    <property name="activationNamespaces">
        <set>
            <value>http://schemas.xmlsoap.org/soap/</value>
            <value>http://schemas.xmlsoap.org/wsdl/soap/</value>
            <value>http://schemas.xmlsoap.org/wsdl/soap12/</value>
            <value>http://www.w3.org/2003/05/soap/bindings/HTTP/</value>
            <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
        </set>
    </property>
    <property name="bus" ref="cxf"/>
</bean>

I found that in order to get it to work I had to manually add in CommonAnnotationBeanPostProcessor and override the SoapBindingFactory to not use lazy-init, as follows:

<bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"/>

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

<bean id="org.apache.cxf.binding.soap.SoapBindingFactory"
  class="org.apache.cxf.binding.soap.SoapBindingFactory">
    <property name="activationNamespaces">
        <set>
            <value>http://schemas.xmlsoap.org/soap/</value>
            <value>http://schemas.xmlsoap.org/wsdl/soap/</value>
            <value>http://schemas.xmlsoap.org/wsdl/soap12/</value>
            <value>http://www.w3.org/2003/05/soap/bindings/HTTP/</value>
            <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
        </set>
    </property>
    <property name="bus" ref="cxf"/>
</bean>

Issue Links:

1 votes, 3 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions