How to replace REST service controller bean (cuba_ServicesControllerManager)

Hello,
since cuba_ServicesControllerManager bean tends to swallow all exceptions which are thrown from a service method (which might be not really good by itself, BTW) I tried to replace it by the custom implementation to do the job, but actually was unable to do it.

We use web module so I put the new impl there and added these lines to web-dispatcher-sprint.xml but the new bean can’t seem to work, the original one still works.

    <!-- Custom REST service controller -->
    <bean id="cuba_ServicesControllerManager"
          class="com.acme.web.bean.CustomServicesControllerManager"/>

What’s the proper way to do it?
Thanks in advance.

Regards,
Ilia.

Hi,

Try creating:

  • Spring configuration file for REST: rest-dispatcher-spring.xml
  • Register bean in that configuration
  • Define an additive application property cuba.restSpringContextConfig in the properties file of the web module, e.g.
    cuba.restSpringContextConfig = +com/company/test/rest-dispatcher-spring.xml

Thanks

2 Likes