1

すべてのリクエストと構成を処理するためにWARすべてを使用する複数の があります。CXFServletSpring

それらはすべて同様のものを共有していますweb.xml(はい、それもオンOSGiです):

<web-app id="app1">
    <context-param>
        <param-name>contextClass</param-name>
        <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
    </context-param>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:META-INF/spring/*.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>app1</servlet-name>
        <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>app1</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>

それらはすべて共通の構成も共有しSpringます ( common-rest.xml):

<beans>
    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <!-- For brevity I left out jaxRSProviders and jaxRSInInterceptors lists definitions -->    
    <bean id="baseJaxRSServer"
        abstract="true"
        lazy-init="false"
        class="org.apache.cxf.jaxrs.spring.JAXRSServerFactoryBeanDefinitionParser.SpringJAXRSServerFactoryBean"
        init-method="create"
        p:address="${http.server}/"
        p:providers-ref="jaxRSProviders"
        p:inInterceptors-ref="jaxRSInInterceptors" />
</beans>

それらにはすべて、同様の特定のSpring構成もあります。

<beans>
    <import resource="classpath:META-INF/app/common-rest.xml" />
    <!-- For brevity I left out app1ServiceBeans list definition -->    
    <bean id="app1JaxRSServer"
        parent="baseJaxRSServer"
        p:serviceBeans-ref="app1ServiceBeans" />
</beans>

問題は、最初のアプリをデプロイしたときはまったく問題ないように見えますが、他のすべてのアプリ バインディングは基本的にまったく表示されないことです。すべてのアプリが別々のSpringコンテキストと別々のCXFサーバーと別々のCXFバスを持っているにもかかわらず、それらはまだどういうわけか混乱しており、それぞれにorg.apache.cxf.transport.Destination最初のバンドルからの 1 つが割り当てられているようです。それがどのように可能か知っている人はいますか?

CXF: 2.6.2、スプリング: 3.1.4、カラフ: 2.3.1

4

2 に答える 2