CXF ignores Spring bean configuration

I have a web application that provides the cxf jax-rs leisure web service. In my application context file, I have something like this:

    ...
<bean id="service" class="SomeClass">
    <constructor-arg index="0">
        <ref bean="bean1" />
    </constructor-arg>
    <constructor-arg index="1"
        value="some value" />

</bean>

<jaxrs:server id="restContainer" address="/">
    <jaxrs:serviceBeans>
        <ref bean="service" />
    </jaxrs:serviceBeans>
    <jaxrs:providers>
        <bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
    </jaxrs:providers>
</jaxrs:server>
    ...

I also have a constructor in my service class that takes these two parameters and initializes the service.

When deploying my application, the spring context loader correctly creates the bean service and the correct constructor is called. The problem is that the first vacation request comes to the service. Cxf Jax-rs creates its own instance with the default constructor, and I lose these two properties.

, args. cxf jax-rs, , ! - cxf?

?

+3

All Articles