Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-4804

Align to JAX-RS deployment model.

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3 GA
    • Fix Version/s: 5.3.1
    • Component/s: None
    • Upgrade notes:
      Hide

      1. To upgrade existing WebEngine modules
      Replace in your pom.xml the JAX-RS API dependency:

      <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>jaxrs-api</artifactId>
      </dependency>

      with the dependency on the latest JAX-RS API:

      <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>jsr311-api</artifactId>
      </dependency>

      That's all.

      2. To upgrade existing JAX-RS apps (not web engine modules) you need to create a real JAX-RS application (as specified by JSR 311) and to deploy it either using a custom servlet and declaring your application in web.xml in your servlet init-params (see specs.) either putting a line in your MANIFEST.MF:

      Nuxeo-WebModule: org.nuxeo.xxx.MyApplication

      where org.nuxeo.xxx.MyApplication is your application class.
      This will deploy your application as part of the webengine servlet (under /nuxeo/site)

      Show
      1. To upgrade existing WebEngine modules Replace in your pom.xml the JAX-RS API dependency: <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>jaxrs-api</artifactId> </dependency> with the dependency on the latest JAX-RS API: <dependency> <groupId>javax.ws.rs</groupId> <artifactId>jsr311-api</artifactId> </dependency> That's all. 2. To upgrade existing JAX-RS apps (not web engine modules) you need to create a real JAX-RS application (as specified by JSR 311) and to deploy it either using a custom servlet and declaring your application in web.xml in your servlet init-params (see specs.) either putting a line in your MANIFEST.MF: Nuxeo-WebModule: org.nuxeo.xxx.MyApplication where org.nuxeo.xxx.MyApplication is your application class. This will deploy your application as part of the webengine servlet (under /nuxeo/site)

      Description

      Use the JAX-RS Application logic to deploy jAX-RS applications.

      This way any pure JAX-RS application can be deployed in Nuxeo.
      Also, it deprecates the resteasy adapter since using the jax-rs deployment model you can deploy webengine modules and JAX-RS apps on any jax-rs backend without the need of an adapter.
      Specific resteasy adapter feaures like guard and tx annotations on methods will be lost (anyway for now these features are not used by WE modules)
      Per resource tx annotation will be possible to be implemented later in a portable way using @TransactionAttribute on resource class.
      Also, the hot reloading mechanism will be deprecated (no more usable) since it requires full control over the JAX-RS engine which is not portable between backends. A new hot reload mechanism will be provided - with less granularity on the scope of the reload than the former one - so it will redeploy all modules (and not only the one that changed) - but more portable.
      The hot reload will be available only for jersey (at least in a first step)

      The task will be done in several steps:

      1. cleanup/prepare existing code to the JAX-RS deployment model.
      2. Implement JAX-RS deployment
      3. Modify webengine-base to use the JAX-RS application deployment model.
      3. Deprecate resteasy adapter and switch to jersey which will become the default backend (since it is closer to the specs than resteasy, solves some important bugs existing on resteasy and also provides nice features like the possibility to plug-in IOC engines like guice)
      4. Update existing JAX-RS code that use the old and dirty way of declaring root resources or body message reader/writers (though static blocks) to switch to new deployment model.
      5. As the hot reloading mechanism will be deprecated a new one will be added that works with jersey.
      6. switch to jersey
      5. Update eclipse plugins to use the new reload mechanism. (notification will change)

      Note that regular WebEngine modules are not affected since they are completely managed by webengine ...

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                PagerDuty

                Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.