jna-platform, xalan, batik-script InvalidModuleDescriptorException

Mandy Chung mandy.chung at oracle.com
Tue Apr 11 00:09:34 UTC 2017


> On Apr 10, 2017, at 2:49 PM, Rahman USTA <rahman.usta.88 at gmail.com> wrote:
> 
> I try to adopt my application to Java 9. It use several 3rd party
> dependency from Maven. I get the following exceptions Because I'm not  the
> author of this libraries, how can I adopt this libraries to my Jigsaw
> project ?
> 

I suggest you contact the maintainer of this library to publish
a version that can be run as a module.  These libraries fail to be
loaded as automatic modules because they reference classes that are
not in the local module.

> Thanks.
> 
> 1) Error occurred during initialization of boot layer
> java.lang.module.FindException: Unable to derive module descriptor for
> \.m2\repository\net\java\dev\jna\jna-platform\4.4.0\jna-platform-4.4.0.jar
> Caused by: java.lang.module.InvalidModuleDescriptorException: Main-Class
> com.sun.jna.Native not in module
> 

com.sun.jna.Native is in a different artifact net.java.dev.jna:jna:4.4.0.
When you place it in the module path as an automatic module, the main class
is expected to be local in the same module.  Since it’s in a different
module, it fails to load jna-platform-4.4.0.jar as automatic module.

jdeps -jdkinternals shows that it depends on an internal API. 

jna-platform-4.4.0.jar -> java.desktop
   com.sun.jna.platform.WindowUtils$MacWindowUtils$1  -> java.awt.peer.ComponentPeer                        JDK internal API (java.desktop)

Similarly, the other InvalidModuleDescriptorException you got indicates
that it fails to load the JAR file as automatic module and reconstitute
the module descriptor.

> 2) Error occurred during initialization of boot layer
> java.lang.module.FindException: Unable to derive module descriptor for
> \.m2\repository\org\apache\xmlgraphics\batik-script\1.8\batik-script-1.8.jar
> Caused by: java.lang.module.InvalidModuleDescriptorException: Provider
> class org.apache.batik.bridge.RhinoInterpreterFactory not in module
> 

There exists META-INF/services/org.apache.batik.script.InterpreterFactory 
config file with a provider class that is not in this module.

> 3) Error occurred during initialization of boot layer
> java.lang.module.FindException: Unable to derive module descriptor for
> \.m2\repository\xalan\xalan\2.7.2\xalan-2.7.2.jar
> Caused by: java.lang.module.InvalidModuleDescriptorException: Provider
> class org.apache.bsf.BSFManager not in module
> 

Similar to batik-script case.

Mandy

> Thanks.
> 
> -- 
> Rahman USTA
> Istanbul JUG
> https://github.com/rahmanusta



More information about the jigsaw-dev mailing list