cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a JAXB-API installation bug in Nuxeo apt package?

Steven_Huwig1
Star Contributor
Star Contributor

I notice that the 6.0-01 package installs:

/var/lib/nuxeo/server/nxserver/lib/jaxb-impl-2.0.3.jar

But after https://jira.nuxeo.com/browse/NXP-12617, Jersey 1.17.1 is required by Nuxeo, and this requires JAXB API 2.1+. I believe this is causing an issue with a Marketplace package I have written that depends on jersey-json with ${jersey.version} (Nuxeo's variable). After the base install, I see these results:

     /var/lib/nuxeo/server/endorsed/jaxb-api-2.0.jar
     /var/lib/nuxeo/server/nxserver/lib/cxf-rt-databinding-jaxb-2.6.8.jar
     /var/lib/nuxeo/server/nxserver/lib/jaxb-impl-2.0.3.jar

And after my package is installed, I see this:

     /var/lib/nuxeo/server/endorsed/jaxb-api-2.0.jar
     /var/lib/nuxeo/server/nxserver/lib/cxf-rt-databinding-jaxb-2.6.8.jar
     /var/lib/nuxeo/server/nxserver/lib/jaxb-impl-2.2.3-1.jar
     /var/lib/nuxeo/server/nxserver/lib/jaxb-api-2.2.2.jar
     /var/lib/nuxeo/server/nxserver/lib/jaxb-impl-2.0.3.jar

This leads to startup failures complaining about the old and new versions of JAXB.

The only dependencies I declare that has anything to do with this are:

<dependency>
  <groupId>com.sun.jersey</groupId>
  <artifactId>jersey-json</artifactId>
  <version>${jersey.version}</version>
</dependency>

<dependency>
  <groupId>com.sun.jersey.contribs</groupId>
  <artifactId>jersey-multipart</artifactId>
  <version>${jersey.version}</version>
</dependency>
4 REPLIES 4

Steven_Huwig1
Star Contributor
Star Contributor

After a second review it seems like the 2.0 jar might not be part of the problem

Steven_Huwig1
Star Contributor
Star Contributor

I ended up doing the following adaptation of the Marketplace packaging we use (based on Nuxeo Marketplace packaging examples on GitHub):

Add an endorsed section to the install.xml template in src/main/resources:

 <install>
  @BUNDLES@
  @LIBS@
  @PROPERTIES@
  @TEMPLATES@
  @ENDORSED@
 </install>

Add code to the assembly.xml file to generate an instruction to copy the jaxb-api jar to endorsed/:

<var name="install.endorsed" value="" />
<if>
  <available file="${outdir}/marketplace/install/lib/jaxb-api-2.2.2.jar" />
  <then>
    <var name="install.endorsed"
         value="${line.separator}
                &lt;copy file=&quot;${package.root}/install/lib/jaxb-api-2.2.2.jar&quot;${line.separator}
                todir=&quot;${env.server.home}/endorsed&quot; overwrite=&quot;true&quot; /&gt;${line.separator}
                &lt;delete file=&quot;${env.server.home}/endorsed/jaxb-api-2.0.jar&quot; /&gt;" />
  </then>
</if>
<copy file="src/main/resources/install.xml"
      todir="${outdir}/marketplace"
      overwrite="true">
    <filter token="BUNDLES" value="${install.bundles}" />
    <filter token="LIBS" value="${install.libs}" />
    <filter token="PROPERTIES" value="${install.properties}" />
    <filter token="TEMPLATES" value="${install.templates}" />
    <filter token="ENDORSED" value="${install.endorsed}" />
</copy>

This produces the effect of removing jaxb-api-2.0.jar and adding jaxb-api-2.2.2.jar to the endorsed/ directory when our custom package is installed. I do not see any obvious problems when I restart Nuxeo and use it on my development machine. However, this seems like a brittle way to address this JAXB API JAR versioning issue.

Is there any better solution?

Thanks, we shouldn't include things in endorsed anymore as the JDK has a more recent version now. This dates from a while back. I opened [NXP-16270](https

Thanks... with that news it seems like handling the workaround (removal of the jaxb-api-2.0.jar) is better done in our server configuration management instead of in the Marketplace package like above.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.