glassfish
  1. glassfish
  2. GLASSFISH-13134

Allow to override javax.* packages on the web application level

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: v3.0.1
    • Fix Version/s: None
    • Component/s: web_container
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Linux

    • Issuezilla Id:
      13,134

      Description

      While there is a good reason to disallow applications to override e.g. the
      standard Servlet API implementation in GlassFish, it could make perfect sense
      for other Java EE APIs. For instance there is already a custom tag in
      sun-web.xml to allow using custom JSF API classes bundled with a web application
      to override the default version bundled with GlassFish. I would like to make
      this possible also for JAX-RS API, and also at the application level.

      Currently, one could use the following command:
      asadmin create-jvm-options
      -Dcom.sun.enterprise.overrideablejavaxpackages=javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext

      together with <class-loader delegate="false"> in the sun-web.xml

      This, however, works only at the application server level and does not allow
      control at the application level as in the JSF case. The drawbacks are obvious:
      if you do not control the whole container, you are out of luck. Also to change
      this just for one application, you would need to restart the whole server
      and interrupt also the other running applications.

      I am going to attach a patch to allow to specify a list of overriden
      Java packages in the GlassFish specific web application descriptor,
      sun-web.xml or glassfish-web.xml, so that the application could
      configure use of it's own bundled Java packages belonging to the protected
      javax.* space.

      Following is an excerpt of how the web application bundling it's own
      JAX-RS implementation should look like after the patch is applied:

      <class-loader delegate="false">
      <property name="overrideablePackages"
      value="javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext"/>
      </class-loader>

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Shing Wai Chan
            Reporter:
            Jakub Podlesak
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: