CMS-3562 Make portal module work in OSGi. Fixed some jaxrs issues.