Apache Karaf、CXF、および Aries Blueprint を使用しています。
多数の JAX-RS サービスを定義するバンドルがあります。デフォルトでは、CXF はこれらのサービスをシングルトンにしますが、これはうまくいきません。各リクエストを処理するには、新しいインスタンスが必要です。
CXF ドキュメントを参照して、サービスの新しいインスタンスを返す JAX-RS ServiceFactories を作成しようとしました。ドキュメントには Spring の例があり、私は同等のブループリントを試みました。
<reference id="groupService" interface="org.ozoneplatform.owf.server.service.api.GroupService"/>
<bean id="groups" class="org.ozoneplatform.owf.server.rest.GroupController" scope="prototype">
<property name="service" ref="groupService"/>
</bean>
<bean id="groupFactory" class="org.apache.cxf.blueprint.jaxrs.BlueprintResourceFactory">
<property name="beanId" value="groups" />
</bean>
<jaxrs:server id="ozoneplatform_cxf_endpoint" address="/owf">
<jaxrs:serviceFactories>
<ref bean="groupFactory" />
</jaxrs:serviceFactories>
ブループリントでエラーが発生しません
org.osgi.service.blueprint.container.ComponentDefinitionException:
Error setting property: PropertyDescriptor <name: resourceProviders, getter: null, setter: [class org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setResourceProviders(interface java.util.List)]