spring - Multiple CXF servers binding gets overridden by the first server -
i have multiple war
s use cxfservlet
handle requests , spring
configuration.
all of them share similar web.xml
(yes, it's on osgi
well):
<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>
all of them share common spring
config (the common-rest.xml
):
<beans> <import resource="classpath:meta-inf/cxf/cxf.xml" /> <!-- brevity left out jaxrsproviders , 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>
all of them have similar specific spring
config well:
<beans> <import resource="classpath:meta-inf/app/common-rest.xml" /> <!-- brevity left out app1servicebeans list definition --> <bean id="app1jaxrsserver" parent="basejaxrsserver" p:servicebeans-ref="app1servicebeans" /> </beans>
the problem is, when deploy first app seems quite ok, every other app bindings not seen @ all. seems despite apps have separete spring
contexts , separate cxf
servers , separate cxf
buses, still somehow confused , each of them gets assigned single org.apache.cxf.transport.destination
- 1 first bundle. know how possible?
cxf: 2.6.2, spring: 3.1.4, karaf: 2.3.1
if you're running inside karaf, i'd suggest first installing cxf feature , after register cxf endpoints via blueprint, it's done apache camel. cause knowledge cxf register 1 "master" servlet @ cxf context, webservices accessible. @ point don't need war. besides didn't show manifest entry regarding web-contextpath, needed web container differ between servable contextes, if of them have same context, first 1 wins!
Comments
Post a Comment