Hello,

I have a problem to declare a JAXRS server with different "serviceBeans"
for each Spring env.
What i'd like is do something like that:

<jaxrs:server id="jaxrsServer" address="/service1">
  <jaxrs:serviceBeans>
    <beans profile="dev">
      <ref bean="serviceBean1" />
      <ref bean="serviceBean2" />
    </beans>
    <beans profile="prod">
      <ref bean="serviceBean2" />
      <ref bean="serviceBean3" />
    </beans>
  </jaxrs:serviceBeans></jaxrs:server>

It is not possible to do so, and I'd like to avoid duplicating the whole
jaxRS config.


I have tried to reference a list:

  <bean id="serviceBeansList" class="java.util.ArrayList">
    <constructor-arg>
      <list>
        <ref bean="serviceBean1"/>
        <ref bean="serviceBean2"/>
      </list>
    </constructor-arg>
  </bean>
<jaxrs:server id="jaxrsServer" address="/service1">
  <jaxrs:serviceBeans>
      <ref bean="serviceBeansList" />
  </jaxrs:serviceBeans></jaxrs:server>


But it doesn't work because the namespace parser seems to always look for a
list.
org.apache.cxf.jaxrs.blueprint.JAXRSServerFactoryBeanDefinitionParser#mapElement
So it doesn't find "2 service beans" but it finds "1 arraylist" and the
list is not flattened.

Any idea?

My original SO question:
http://stackoverflow.com/questions/13344564/using-spring-profiles-inside-a-namespace


I'd like to keep going with the namespace without having to create my own
factorybeans.


Thanks!

Reply via email to