JDK9 approach to limiting package to one module

Stephen Felts stephen.felts at oracle.com
Thu Mar 30 08:49:26 UTC 2017


Apparently it's in some earlier versions of Xalan and Xerces.
For example, there is JDK-4827955 NoClassDefFoundError: org/w3c/dom/ls/DocumentLS causing failures in xalan conf
where it needed to be removed from jaxp.

It was removed from Xalan going from 2.5.1 to 2.6.0 (http://depfind.sourceforge.net/Samples/xalan.html).

Apparently we have an ancient Xerces jar file.

So the options are:
1. Use a newer Xerces/Xalan.
2. Use a patch jar file to add it to the package.  That seems like a gamble that everything else will line up with the JDK.
3. Repackage our version of these class files


-----Original Message-----
From: Alan Bateman 
Sent: Thursday, March 30, 2017 3:36 AM
To: Stephen Felts; jigsaw-dev at openjdk.java.net
Subject: Re: JDK9 approach to limiting package to one module

On 30/03/2017 03:41, Stephen Felts wrote:

> We ran into a problem today caused by the JDK 9 single-module package limitation.
>
> We have an Apache jar file that references org.w3c.dom.ls.DocumentLS that is in another jar on the classpath. However, the incomplete org.w3c.dom.ls package is also in the JDK so the JDK wins and we get a class definition not found.
> This works on JDK 8 but not JDK 9.
> The only way to get around this without using a patch jar (I assume that might work) is to repackage org.w3c.dom in our jar files.
> Is there another solution?   Can we get a complete package added to the JDK?
org.w3c.dom was one of the Endorsed Standards APIs in Java SE 8 and older and so was upgradeable via the endorsed standards override mechanism. It was never upgradeable via the class path.

As regards DocumentLS then I think this needs someone familiar with this API to comment. I checked the Java Language Bindings for the DOM L3 Load and Save spec but I don't see it. I do see drafts from 2002/2003 that reference it, is it possible that this interface didn't make the final release?

-Alan


More information about the jigsaw-dev mailing list