Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Nov 23, 2009 · 11 comments
Closed

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

spring-projects-issues opened this issue Nov 23, 2009 · 11 comments
Labels
type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 23, 2009

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I'm not sure I fully understand the breaking change... So that @PostConstruct method is not being called when the bean is marked as lazy-init but it is called once you remove the lazy flag? Why did you have to manually add that CommonAnnotationBeanPostProcessor? Without that post-processor being present (possibly implicitly through context:annotation-config/), no @PostConstruct method would ever have been called - neither on eager nor on lazy beans.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 24, 2009

Costin Leau commented

David, could you please try the trunk since the #11032 might be causing the issues you face? Just to be on the safe side. Thanks!

@spring-projects-issues
Copy link
Collaborator Author

Costin Leau commented

Hi Dave,

The problem seems to be fixed from what I can see in my tests. I've tried the wsdl_first sample with RC2 (which displayed the problem described here) and then the nightly build with worked as expected.
It would be great if you could confirm this as well.

Thanks!

@spring-projects-issues
Copy link
Collaborator Author

David Ward commented

Hi Costin

That's great to hear. Unfortunately, when I tried to take a new snapshot of Spring v3, I found that it introduced new dependencies on Hibernate v3.3, that would force us to move from our patched version of Hibernate v3.2. The offending class was org.springframework.orm.hibernate3.LocalSessionFactoryBean and its dependency on org.hibernate.cache.RegionFactory which doesn't exist and v3.2 and causes an introspection error. So we won't be able to test against the latest stack without some major refactoring on our part. Are there any plans to make Hibernate v3.3 optional? It's a shame this has crept in since RC2.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 27, 2009

Costin Leau commented

Dave, I've raised #11125 to address the Hibernate issue. In the meantime can you provide a basic test case or some sample inside the CXF distribution that I can test against the CXF fix?
I'd like to know whether this is related to #11032 or not?
Cheers.

@spring-projects-issues
Copy link
Collaborator Author

Costin Leau commented

Dave, I've checked with Juergen and this is fixed (I can confirm as I've just tried Petclinic with Hibernate 3.2.6 and trunk). Have you tried the latest snapshot (477)?

@spring-projects-issues
Copy link
Collaborator Author

David Ward commented

Good news. I will give it a shot and let you know.

@spring-projects-issues
Copy link
Collaborator Author

Costin Leau commented

Hi Dave? Any update? We're about to release RC3 and we'd like to address this issue (if it's still present).
Thanks.

@spring-projects-issues
Copy link
Collaborator Author

David Ward commented

Hi Costin. Sorry for the delay. Just tried out CI-477 and it appears to fix all our issues.

BTW, how many more RCs will there be?

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good to hear that it works for you now...

On very recent news, it's likely that we're doing an RC3 tomorrow before going GA next week. All of the issues currently marked as resolved in 3.0 final (like this one) will be actually fixed in RC3 then.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Costin Leau commented

Thanks for the feedback Dave. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant