Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartaee-platform-dev] What does it mean for Jakarta EE 9 Full Platform that Jakarta RESTful Web Services are depending on (optional) Jakarta XML Binding in Jakarta EE 9?

These type of changes to the pom and module-info look to help with this optional aspect of jaxb.  Thanks!  I've been following the conversation in the PR as well.


---------------------------------------------------
Kevin Sutter
STSM, MicroProfile and Jakarta EE architect @ IBM
e-mail:  sutter@xxxxxxxxxx     Twitter:  @kwsutter
phone: tl-553-3620 (office), 507-253-3620 (office)    
LinkedIn:
https://www.linkedin.com/in/kevinwsutter



From:        Lukas Jungmann <lukas.jungmann@xxxxxxxxxx>
To:        jakartaee-platform-dev@xxxxxxxxxxx
Date:        09/21/2020 15:05
Subject:        [EXTERNAL] Re: [jakartaee-platform-dev] What does it mean for Jakarta EE 9 Full Platform that Jakarta RESTful Web Services are depending on (optional) Jakarta XML Binding in Jakarta EE 9?
Sent by:        jakartaee-platform-dev-bounces@xxxxxxxxxxx




On 9/21/20 9:53 PM, Andy McCright wrote:
>  > Java SE 11 as well as OSGi are going to treat the dependency of
>  > jakarta.ws.rs-api 3.0.0 which is in staging right now on jaxb-api as
>  > required. Java SE 11 is probably not important but OSGi should be...
>
> I'm not sure how to address Java SE 11 dependencies,


replace `requires transitive jakarta.xml.bind;` with `requires static
jakarta.xml.bind;` in module-info[1]. That will do the trick for JPMS.
Marking dependency on xml.bind-api optional in project's pom[2] should
resolve the problem for OSGi.

thanks for taking care of this.

thanks,
--lukas

[1]:
https://github.com/eclipse-ee4j/jaxrs-api/blob/master/jaxrs-api/src/main/java/module-info.java#L19

[2]:
https://github.com/eclipse-ee4j/jaxrs-api/blob/master/jaxrs-api/pom.xml#L497


 but I can update
> the OSGi manifest to make the import of the XML Binding packages
> optional (resolution:=optional).  I agree that that would make things
> more clear that these packages are optional.  Thanks for the suggestion!
>
> Any disagreement or other thoughts before I make this change?
>
> Thanks,
>
> Andy
>
> On Mon, Sep 21, 2020 at 9:43 AM Lukas Jungmann
> <lukas.jungmann@xxxxxxxxxx <
mailto:lukas.jungmann@xxxxxxxxxx>> wrote:
>
>     On 9/21/20 3:23 PM, Andy McCright wrote:
>      >  > So, jax-rs requires jaxb when building.  Building the api?
>     Building
>      > jersey?  both?
>      >
>      > Building the API for sure - I'm not sure about Jersey, but I
>     would think
>      > that it would also require the dependency if it is implementing
>     the Link
>      > (and especially the Link.JaxbAdapter inner class) API.
>      >
>      >> Does the resulting api binary have a dependency on jaxb?  If it
>     does,
>      > then that's a problem.
>      >
>      > Yes it does.  But users should not notice the dependency unless they
>      > explicitly use the Link class.  Since the vast majority of
>     RESTful WS
>      > function is available without using that class, I would claim
>     that it is
>      > an /optional/ dependency.
>
>
>     Java SE 11 as well as OSGi are going to treat the dependency of
>     jakarta.ws.rs-api 3.0.0 which is in staging right now on jaxb-api as
>     required. Java SE 11 is probably not important but OSGi should be...
>
>     thanks,
>     --lukas
>
>      >
>      >> I'm not clear on this "Link" class.  I guess this gets back to the
>      > previous question.  If the dependency on jaxb is soft and
>     dynamic, and
>      > the only time that the dependency is required is when this "Link"
>     class
>      > is utilized, then we're getting closer to workable solution.
>      >
>      > It is certainly a hard dependency from the Link.JaxbAdapter inner
>      > class.  It is not soft/dynamic from the perspective that it is
>     loaded
>      > reflectively and handled gracefully if not available.  If a user
>      > attempts to use this class without having Jakarta XML Binding in
>     their
>      > classpath, they will see a nasty
>      > ClassNotFoundException/NoClassDefFoundError like Scott reported.
>      >
>      >> Is this "Link" class marked "optional" as part of the API?
>      >
>      > The javadoc has the wording I mentioned previously.  Is there a more
>      > official way to mark the class as "optional"?
>      >
>      >
>      >> Does the TCK test this "Link" class and are those tests marked
>     optional?
>      >
>      > The TCK does use the Link class, and afaict those tests are not
>      > currently marked optional.
>      >
>      > In the Jakarta RESTful WS spec, there are requirements for
>      > implementations when other Jakarta APIs are available.  For
>     example, an
>      > implementation is required to supply a built-in JSON-B provider
>     if the
>      > JSON-B APIs are available.  I don't know how (or if) this is
>     tested in
>      > the TCK, but IMO we should use a similar mechanism to test the Link
>      > class - basically something like JUnit's "assume" method - i.e.
>      > assumeThat(canLoadJakartaXMLBindingAPIs()); That should prevent
>     the test
>      > from failing if the environment does not have XML Binding, but
>     should
>      > perform the test if it does.
>      >
>      > Hope this helps,
>      >
>      > Andy
>      >
>      >
>      > On Fri, Sep 18, 2020 at 7:49 AM Kevin Sutter <sutter@xxxxxxxxxx
>     <
mailto:sutter@xxxxxxxxxx>
>      > <
mailto:sutter@xxxxxxxxxx<mailto:sutter@xxxxxxxxxx>>> wrote:
>      >
>      >     Hi Andy,
>      >     Thanks for the background information.  But, I'm just not
>     familiar
>      >     enough with the jax-rs architecture to know if the solution is
>      >     sufficient.
>      >
>      >     >  So, what this means is that RESTful WS depends on XML
>     Binding API at
>      >     build time.  The Link class is rarely used in user
>     applications, but
>      >     when it is, users must ensure that their runtime environment
>      >     includes XML Binding APIs and an implementation.  For most users,
>      >     they will not need a runtime dependency on XML Binding.
>      >
>      >     So, jax-rs requires jaxb when building.  Building the api?
>     Building
>      >     jersey?  both?
>      >
>      >     Does the resulting api binary have a dependency on jaxb?  If it
>      >     does, then that's a problem.
>      >
>      >     I'm not clear on this "Link" class.  I guess this gets back
>     to the
>      >     previous question.  If the dependency on jaxb is soft and
>     dynamic,
>      >     and the only time that the dependency is required is when this
>      >     "Link" class is utilized, then we're getting closer to workable
>      >     solution.  Is this "Link" class marked "optional" as part of the
>      >     API?  Does the TCK test this "Link" class and are those tests
>     marked
>      >     optional?
>      >
>      >     Bottom line is that with jaxb being marked as an Optional
>      >     technology, then the standard jax-rs and jakarta ee runtime
>     can not
>      >     have a hard, non-optional dependency on jaxb.
>      >
>      >     ---------------------------------------------------
>      >     Kevin Sutter
>      >     STSM, MicroProfile and Jakarta EE architect @ IBM
>      >     e-mail: sutter@xxxxxxxxxx <
mailto:sutter@xxxxxxxxxx>
>     <
mailto:sutter@xxxxxxxxxx<mailto:sutter@xxxxxxxxxx>>     Twitter:
>      >       @kwsutter
>      >     phone: tl-553-3620 (office), 507-253-3620 (office)
>      >     LinkedIn:
https://www.linkedin.com/in/kevinwsutter
>     <
https://www.linkedin.com/in/kevinwsutter>
>      >  
>       <
https://www.linkedin.com/in/kevinwsutter>
>      >
>      >
>      >
>      >     From: Andy McCright <j.andrew.mccright@xxxxxxxxx
>     <
mailto:j.andrew.mccright@xxxxxxxxx>
>      >     <
mailto:j.andrew.mccright@xxxxxxxxx
>     <
mailto:j.andrew.mccright@xxxxxxxxx>>>
>      >     To: jakartaee-platform developer discussions
>      >     <jakartaee-platform-dev@xxxxxxxxxxx
>     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx>
>      >     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx
>     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx>>>
>      >     Cc: Kevin Sutter <sutter@xxxxxxxxxx
>     <
mailto:sutter@xxxxxxxxxx> <mailto:sutter@xxxxxxxxxx
>     <
mailto:sutter@xxxxxxxxxx>>>
>      >     Date: 09/17/2020 20:26
>      >     Subject: [EXTERNAL] Re: [jakartaee-platform-dev] What does it
>     mean
>      >     for Jakarta EE 9 Full Platform that Jakarta RESTful Web
>     Services are
>      >     depending on (optional) Jakarta XML Binding in Jakarta EE 9?
>      >  
>       ------------------------------------------------------------------------
>      >
>      >
>      >
>      >     Hi All, The dependency has been there since JAX-RS 2.0.  When
>     we had
>      >     discussed this...
>      >     *This Message Is From an External Sender*
>      >     This message came from outside your organization.
>      >
>      >
>      >     Hi All,
>      >
>      >     The dependency has been there since JAX-RS 2.0.  When we had
>      >     discussed this previously we decided that we could not remove the
>      >     dependency as that would be a breaking change. Instead we decided
>      >     that user applications that use this API are responsible for
>      >     providing the Jakarta XML Binding APIs and implementation
>      >     (either through their own app or through the vendor app server).
>      >     Back in March, I added these lines to the Javadocs:
>      >
>      >            * Note that usage of this class requires the Jakarta XML
>      >     Binding API and an implementation. The Jakarta RESTful Web
>      >            * Services implementation is not required to provide these
>      >     dependencies.
>      >
>      >     So, what this means is that RESTful WS depends on XML Binding
>     API at
>      >     build time.  The Link class is rarely used in user
>     applications, but
>      >     when it is, users must ensure that their runtime environment
>      >     includes XML Binding APIs and an implementation. For most users,
>      >     they will not need a runtime dependency on XML Binding.
>      >
>      >     At the time we discussed this, it was approved by the RESTful WS
>      >     project and at least consensus reached by the platform committee,
>      >     but if we don't like that answer now, I'm open to considering
>     other
>      >     options.
>      >
>      >     Hope this helps,
>      >
>      >     Andy
>      >
>      >     On Thu, Sep 17, 2020 at 2:20 PM Scott Marlow
>     <_smarlow@redhat.com_
>      >     <
mailto:smarlow@xxxxxxxxxx<mailto:smarlow@xxxxxxxxxx>>> wrote:
>      >
>      >
>      >
>      >     On 9/17/20 2:41 PM, Kevin Sutter wrote:
>      >     > According to the early discussions on this topic, the
>     JAX-RS team  had
>      >     > indicated they would be changing their spec, api, javadoc
>     (whatever)  to
>      >     > allow for jaxb to be optional.  It looks like the javadoc
>     (at  least)
>      >     > still indicates that jaxb is required. That has to change
>     (at a
>      >     > minimum).  Once this is properly delineated as optional,
>     then  any
>      >     > corresponding TCKs will need to be marked optional as well.
>      Which  would
>      >     > then flow into the Platform TCK...
>      >     _
>      >     __
https://github.com/eclipse-ee4j/jaxrs-api/issues/906_
>     <
https://github.com/eclipse-ee4j/jaxrs-api/issues/906_>
>      >  
>       <
https://github.com/eclipse-ee4j/jaxrs-api/issues/906>is
>      >     for updating
>      >     jakarta.ws.rs.core.Link to not depend on optional (for
>     Jakarta EE 9)
>      >     jakarta.xml.bind (JAXB).  The issue includes a link to this
>     mailing
>      >     list
>      >     conversation.
>      >
>      >     Scott
>      >
>      >     >
>      >     > ---------------------------------------------------
>      >     > Kevin Sutter
>      >     > STSM, MicroProfile and Jakarta EE architect @ IBM
>      >     > e-mail: Â _sutter@xxxxxx.com_ <
mailto:sutter@xxxxxxxxxx
>     <
mailto:sutter@xxxxxxxxxx>>    Twitter:  @kwsutter
>      >     > phone: tl-553-3620 (office), 507-253-3620 (office)
>      >     > LinkedIn: _
https://www.linkedin.com/in/kevinwsutter_
>     <
https://www.linkedin.com/in/kevinwsutter_>
>      >  
>       <
https://www.linkedin.com/in/kevinwsutter>
>      >     >
>      >     >
>      >     >
>      >     > From: Scott Marlow <_smarlow@redhat.com_
>     <
mailto:smarlow@xxxxxxxxxx<mailto:smarlow@xxxxxxxxxx>>>
>      >     > To: jakartaee-platform developer discussions
>      >     > <_jakartaee-platform-dev@eclipse.org_
>      >     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx
>     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx>>>
>      >     > Date: 09/17/2020 13:26
>      >     > Subject: [EXTERNAL] [jakartaee-platform-dev] What does it
>     mean for
>      >     > Jakarta EE 9 Full Platform that Jakarta RESTful Web
>     Services are
>      >     > depending on (optional) Jakarta XML Binding in Jakarta EE 9?
>      >     > Sent by: _jakartaee-platform-dev-bounces@eclipse.org_
>      >     <
mailto:jakartaee-platform-dev-bounces@xxxxxxxxxxx
>     <
mailto:jakartaee-platform-dev-bounces@xxxxxxxxxxx>>
>      >     >
>     ------------------------------------------------------------------------
>      >     >
>      >     >
>      >     >
>      >     > Hi,
>      >     >
>      >     > It looks like Jakarta RESTful Web Services SPEC API depends on
>      >     > (optional) Jakarta XML Binding.  See line 28 in jaxrs-api
>     [1]  (line 551
>      >     > is also interesting).
>      >     >
>      >     > How can Jakarta XML Binding be optional [2] if Jakarta
>     RESTful Web
>      >     > Services depends on them?
>      >     >
>      >     > Thanks Alwin for mentioning this on
>     jakartaee-tck/issues/491 [3]!
>      >     >
>      >     > Scott
>      >     >
>      >     > [1]
>      >     >
>     _
https://github.com/eclipse-ee4j/jaxrs-api/blob/master/jaxrs-api/src/main/java/jakarta/ws/rs/core/Link.java#L28_
>     <
https://github.com/eclipse-ee4j/jaxrs-api/blob/master/jaxrs-api/src/main/java/jakarta/ws/rs/core/Link.java#L28_>
>      >  
>       <
https://github.com/eclipse-ee4j/jaxrs-api/blob/master/jaxrs-api/src/main/java/jakarta/ws/rs/core/Link.java#L28>
>      >     >
>      >     > [2]
>      >     >
>     _
https://jakarta.ee/specifications/platform/9/platform-spec-9-SNAPSHOT.html#xml-binding-3-0-requirements-optional_
>     <
https://jakarta.ee/specifications/platform/9/platform-spec-9-SNAPSHOT.html#xml-binding-3-0-requirements-optional_>
>      >  
>       <
https://jakarta.ee/specifications/platform/9/platform-spec-9-SNAPSHOT.html#xml-binding-3-0-requirements-optional>
>      >     >
>      >     > [3]
>      >     >
>     _
https://github.com/eclipse-ee4j/jakartaee-tck/issues/491#issuecomment-694324790_
>     <
https://github.com/eclipse-ee4j/jakartaee-tck/issues/491#issuecomment-694324790_>
>      >  
>       <
https://github.com/eclipse-ee4j/jakartaee-tck/issues/491#issuecomment-694324790>
>      >     >
>      >     > _______________________________________________
>      >     > jakartaee-platform-dev mailing list
>      >     > _jakartaee-platform-dev@eclipse.org_
>      >     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx
>     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx>>
>      >     > To unsubscribe from this list, visit
>      >     >
>     _
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev_
>     <
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev_>
>      >  
>       <
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev>
>      >     >
>      >     >
>      >     >
>      >     >
>      >     >
>      >     > _______________________________________________
>      >     > jakartaee-platform-dev mailing list
>      >     > _jakartaee-platform-dev@eclipse.org_
>      >     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx
>     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx>>
>      >     > To unsubscribe from this list, visit
>     _
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev_
>     <
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev_>
>      >  
>       <
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev>
>      >     >
>      >
>      >     _______________________________________________
>      >     jakartaee-platform-dev mailing list_
>      >     __jakartaee-platform-dev@eclipse.org_
>      >     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx
>     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx>>
>      >     To unsubscribe from this list, visit
>      >  
>       _
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev_
>     <
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev_>
>      >  
>       <
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev>
>      >
>      >
>      >
>      > _______________________________________________
>      > jakartaee-platform-dev mailing list
>      > jakartaee-platform-dev@xxxxxxxxxxx
>     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx>
>      > To unsubscribe from this list, visit
>    
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev
>      >
>     _______________________________________________
>     jakartaee-platform-dev mailing list
>     jakartaee-platform-dev@xxxxxxxxxxx
>     <
mailto:jakartaee-platform-dev@xxxxxxxxxxx>
>     To unsubscribe from this list, visit
>    
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev
>     <
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev>
>
>
> _______________________________________________
> jakartaee-platform-dev mailing list
> jakartaee-platform-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev
>
_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev





Back to the top