I create a JAXRS server endpoint (CXF 3.5.2) using spring bean declarations
like:



     <jaxrs:server id="restServer" basePackages="xxx">

           <jaxrs:serviceBeans>

                <ref bean="TestApi" />

           </jaxrs:serviceBeans>

           <jaxrs:providers>

                <…/>

           </jaxrs:providers>

           <jaxrs:features>

                <… />

           </jaxrs:features>

           <jaxrs:inInterceptors>

                <… />

           </jaxrs:inInterceptors>

*           <jaxrs:outInterceptors>*

*                <**…**/>*

*           </jaxrs:outInterceptors>*

     </jaxrs:server>



Where  my TestApi interface is declared like:

@Path("accounts")

@Consumes(MediaType.*APPLICATION_JSON*)

@Produces(MediaType.*APPLICATION_JSON*)

*public* *interface* TestApi {

…

}

Because I’ve got the @Path declaration on the interface type I’ve omitted
the ‘address’ attribute on the jaxrs:server declaration (otherwise I
noticed that the server would be listening to
/basepath/accounts/accounts/…).



Now this configuration works perfectly, only when shutting down cxf call
ServerImpl#destroy() which delegates (via Obeservable) to
AbstractHTTPDestination#deactivate() which calls
registry.removeDestination(path). This path is null (no ‘address’ specified
on jaxrs:server declaration) and results in a NPE on the registry Map.



Is this an error in cxf or is my server configured incorrectly? How does
the ‘address’ attribute on the jaxrs:server declaration correctly interact
with the @Path parameter on the API interface?



Sincerely,



J.P. Urkens

Reply via email to