Hi,

I am having problems migrating from CXF 2.2.12 to 2.6.x and would like advice 
on how best to proceed. My servlet configuration and jaxrs:server configuration 
that was working with 2.2.12 does not work with 2.6.x

I have the following servlet:

        <servlet>
                <servlet-name>CXFServlet</servlet-name>
                <servlet-class>org.apache.cxf.transport.servlet.CXFServlet
                </servlet-class>
                <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
                <servlet-name>CXFServlet</servlet-name>
                <url-pattern>/rs/*</url-pattern>
                <url-pattern>/preference-rest/*</url-pattern>
        </servlet-mapping>

I have the following jaxrs:server config:

      <jaxrs:server id="wap2" address="/">
        <jaxrs:serviceBeans>
             <ref bean="systemDashletRESTImpl"/>
            <ref bean="userPreference"/>
        </jaxrs:serviceBeans>
        <jaxrs:providers>
            <ref bean="jsonProvider6" />
            <ref bean="i18nWebAppExcMapper" />
        </jaxrs:providers>
        <jaxrs:extensionMappings>
           <entry key="json" value="application/json"/>
        </jaxrs:extensionMappings>


The clients of userPreference call URL containing "/preference-rest/".

The clients of systemDashletRESTImpl call URL containing "/rs/".

I have found that the calls to the systemDashletRESTImpl fail with this message:

[2014-09-22 04:31:32,616] [http-bio-443-exec-5] [JAXRSInInterceptor] [WARN ] - 
No root resource matching request path /webacs/rs/system-rest/getsysteminfo has 
been found, Relative Path: /webacs/rs/system-rest/getsysteminfo. Please enable 
FINE/TRACE log level for more details.

In debugger I can see the issue is related to:

org.apache.cxf.transport.http.DestinationImpl where the destinations field is a 
Map between URL and AbstractHTTPDestination. Because systemDashletRESTImpl and 
userPreference are both using the address '/' what happens is that the value 
held in the destinations field is that for the preferences resource and the 
systemDashletRESTImpl resource entry gets overwritten.

Is this a regression in CXF? This configuration all works in CXF 2.2.12.

Can you advise on how I can get this working with 2.6.x? Preferably without any 
of the resource URLs changing (as I do not want to change the client code) and 
preferably without any change to the resource code. Is there something I can do 
in CXF configuration to get this working again? E.g. Implement resource 
comparator?


Thanks
Duncan

Reply via email to