glassfish
  1. glassfish
  2. GLASSFISH-13236

[jersey] Jersey bundles optionally depend mandatory packages

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 4.0_b67_ms7
    • Component/s: jax-rs
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      I see code like this jersey-json bundle:
      ./1.4-ea05/src/main/java/com/sun/jersey/json/impl/reader/Jackson2StaxReader.java

      import com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext;

      public int getAttributeCount() {

      final UnmarshallingContext uctx =
      UnmarshallingContext.getInstance();
      ...

      Yet, this bundle has optionally import com.sun.xml.bind.v2.runtime.unmarshaller
      package as shown below:

      Import-Package =
      com.sun.jersey.api.json,com.sun.jersey.core.provider,com.sun.jersey.core.provider.jaxb,com.sun.jersey.core.util,com.sun.jersey.json.impl,com.sun.jersey.json.impl.provider.entity,com.sun.jersey.json.impl.reader,com.sun.jersey.json.impl.writer,com.sun.jersey.localization,com.sun.jersey.spi,com.sun.xml.bind.annotation;resolution:=optional,com.sun.xml.bind.v2.model.core;resolution:=optional,com.sun.xml.bind.v2.model.runtime;resolution:=optional,com.sun.xml.bind.v2.runtime;resolution:=optional,com.sun.xml.bind.v2.runtime.property;resolution:=optional,com.sun.xml.bind.v2.runtime.unmarshaller;resolution:=optional,javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.namespace,javax.xml.stream,javax.xml.transform,javax.xml.validation,org.codehaus.jackson;version="1.5",org.codehaus.jackson.jaxrs;version="1.5",org.codehaus.jackson.map;version="1.5",org.codehaus.jackson.type;version="1.5",org.codehaus.jettison.badgerfish;version="1.1",org.codehaus.jettison.json;version="1.1",org.codehaus.jettison.mapped;version="1.1",org.w3c.dom,org.xml.sax

      How can this class load in the absence of such a package?

      This is causing OSGi class loader constraint violation when we add jaxb packages
      to system bundle.

      Pl. note this is a P2, as other P2 bug depends on this.
      Sahoo

        Issue Links

          Activity

          Hide
          Jakub Podlesak added a comment -

          This has been fixed be breaking jersey json support down into several modules. Two of them are being bundled with GF:

          ./bin/asadmin osgi lb jersey
          START LEVEL 2
          ID|State |Level|Name
          164|Resolved | 1|jersey-core-client (2.0.0.m10)
          165|Resolved | 1|jersey-core-common (2.0.0.m10)
          166|Resolved | 1|jersey-container-grizzly2-http (2.0.0.m10)
          167|Installed | 1|jersey-container-servlet-core (2.0.0.m10)
          168|Installed | 1|jersey-container-servlet (2.0.0.m10)
          169|Resolved | 1|jersey-gf-ejb (2.0.0.m10)
          170|Resolved | 1|jersey-media-json-jackson (2.0.0.m10)
          171|Resolved | 1|jersey-media-json-jettison (2.0.0.m10)
          172|Installed | 1|jersey-media-moxy (2.0.0.m10)
          173|Resolved | 1|jersey-media-multipart (2.0.0.m10)
          174|Resolved | 1|jersey-media-sse (2.0.0.m10)
          175|Resolved | 1|jersey-core-server (2.0.0.m10)

          ./bin/asadmin osgi start 170 171
          Command osgi executed successfully.

          ./bin/asadmin osgi lb jersey
          START LEVEL 2
          ID|State |Level|Name
          164|Resolved | 1|jersey-core-client (2.0.0.m10)
          165|Resolved | 1|jersey-core-common (2.0.0.m10)
          166|Resolved | 1|jersey-container-grizzly2-http (2.0.0.m10)
          167|Installed | 1|jersey-container-servlet-core (2.0.0.m10)
          168|Installed | 1|jersey-container-servlet (2.0.0.m10)
          169|Resolved | 1|jersey-gf-ejb (2.0.0.m10)
          170|Active | 1|jersey-media-json-jackson (2.0.0.m10)
          171|Active | 1|jersey-media-json-jettison (2.0.0.m10)
          172|Installed | 1|jersey-media-moxy (2.0.0.m10)
          173|Resolved | 1|jersey-media-multipart (2.0.0.m10)
          174|Resolved | 1|jersey-media-sse (2.0.0.m10)
          175|Resolved | 1|jersey-core-server (2.0.0.m10)

          Show
          Jakub Podlesak added a comment - This has been fixed be breaking jersey json support down into several modules. Two of them are being bundled with GF: ./bin/asadmin osgi lb jersey START LEVEL 2 ID|State |Level|Name 164|Resolved | 1|jersey-core-client (2.0.0.m10) 165|Resolved | 1|jersey-core-common (2.0.0.m10) 166|Resolved | 1|jersey-container-grizzly2-http (2.0.0.m10) 167|Installed | 1|jersey-container-servlet-core (2.0.0.m10) 168|Installed | 1|jersey-container-servlet (2.0.0.m10) 169|Resolved | 1|jersey-gf-ejb (2.0.0.m10) 170|Resolved | 1|jersey-media-json-jackson (2.0.0.m10) 171|Resolved | 1|jersey-media-json-jettison (2.0.0.m10) 172|Installed | 1|jersey-media-moxy (2.0.0.m10) 173|Resolved | 1|jersey-media-multipart (2.0.0.m10) 174|Resolved | 1|jersey-media-sse (2.0.0.m10) 175|Resolved | 1|jersey-core-server (2.0.0.m10) ./bin/asadmin osgi start 170 171 Command osgi executed successfully. ./bin/asadmin osgi lb jersey START LEVEL 2 ID|State |Level|Name 164|Resolved | 1|jersey-core-client (2.0.0.m10) 165|Resolved | 1|jersey-core-common (2.0.0.m10) 166|Resolved | 1|jersey-container-grizzly2-http (2.0.0.m10) 167|Installed | 1|jersey-container-servlet-core (2.0.0.m10) 168|Installed | 1|jersey-container-servlet (2.0.0.m10) 169|Resolved | 1|jersey-gf-ejb (2.0.0.m10) 170|Active | 1|jersey-media-json-jackson (2.0.0.m10) 171|Active | 1|jersey-media-json-jettison (2.0.0.m10) 172|Installed | 1|jersey-media-moxy (2.0.0.m10) 173|Resolved | 1|jersey-media-multipart (2.0.0.m10) 174|Resolved | 1|jersey-media-sse (2.0.0.m10) 175|Resolved | 1|jersey-core-server (2.0.0.m10)
          Hide
          scatari added a comment -

          Marking this to be considered for next release. Does not affect the functionality of the release 3.1.1.

          Show
          scatari added a comment - Marking this to be considered for next release. Does not affect the functionality of the release 3.1.1.
          Hide
          Martin Matula added a comment -

          Agree with Sahoo. But not for 3.1.

          Show
          Martin Matula added a comment - Agree with Sahoo. But not for 3.1.
          Hide
          Sanjeeb Sahoo added a comment -

          needs to be fixed by jersey team

          Show
          Sanjeeb Sahoo added a comment - needs to be fixed by jersey team
          Hide
          Chris Kasso added a comment -

          Changed Target milestone back to not determined. MS6 has sailed.

          Show
          Chris Kasso added a comment - Changed Target milestone back to not determined. MS6 has sailed.

            People

            • Assignee:
              Jakub Podlesak
              Reporter:
              Sanjeeb Sahoo
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: