Ben ODay
Ben ODay

Reputation: 21005

OSGi bundle restart with cxf-extension-osgi

I have a simple CXF RS bundle deployed in Fuse 4.2 that works fine upon initial installation. But, when I update or re-install the bundle, the REST service in no longer accessible.

I tried a various configurations and found that using cxf-extension-osgi was the issue...

from this...

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

to this...

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

Also, I updated the address to be non-relative...ending up with this configuration (that works after bundle restarts, etc)

<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />

<jaxrs:server id="testService" address="http://localhost:9000/">
    <jaxrs:serviceBeans>
        <ref bean="testBean" />
    </jaxrs:serviceBeans>
</jaxrs:server>

Any idea what is causing this issue when using cxf-extension-osgi? Also, what is the trade-off when using cxf-extendsion-http-jetty instead (functional, performance, etc)?

thanks

Upvotes: 1

Views: 1317

Answers (2)

Ben ODay
Ben ODay

Reputation: 21005

I just tested this in Fuse 4.3.0-fuse-03-00 and it seems to work fine. The related issue below must have addressed my issue as well...

https://issues.apache.org/jira/browse/CXF-2947

Upvotes: 1

Cjxcz Odjcayrwl
Cjxcz Odjcayrwl

Reputation: 22847

Sorry, it seems to be error in cxf/servicemix integration. The problem is, cxf tries to register service under the address that is already used (by older version of this service).

Both REST and SOAP services are unaccessible after bundle restart/update. Restart of whole servicemix. Hovewer, when business logic is in other bundle, and the bundle with SOAP/REST service contains only interface, restart is needed only when interface has changed.

We were fighting with this error long, but unfortunatelly without effort.

Upvotes: 1

Related Questions