Unable to derive module descriptor: Provider {class X} not in module
Asked Answered
B

2

16

I am getting this error message when I try to compile my new modularized Java 11 application:

Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for C:\Users\inter\.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

This appears to be an issue from a dependency of a dependency. I can't even find which module is pulling it in so I can update it.

I am using openjdk 11.0.2, IntelliJ 2018.3.4, Maven

Any advice how I can troubleshoot or fix this? I have found very little documentation on this issue.

Beisel answered 14/2, 2019 at 2:36 Comment(0)
B
8

Xalan

I had a look at their bug tracker following their index page and wasn't able to find this reported and not sure how actively is the library being maintained either.


General Explanation

Just to explain what has caused the issue in your code, I would share a screenshot and then try to add details around it.

Screenshot

So within the JAR that for version 2.7.2, there are service declarations (META-INF/services) which include org.apache.xalan.extensions.bsf.BSFManager as one of them. The service file here has to indicate the Provider thereby for itself and the class is supposed to be present on the modulepath to be resolved for reliable configuration of modules.

In this case for the module xalan(automatic module), the service listed doesn't have the provider class packaged within the dependency itself. (See the package org.apache, it doesn't further have package bsf and the class BSFManager thereby. Hence the exception as you get.

Short term hack

One of the tweaks to get that resolved would be to get update the library jar (patch it) and get rid of the service file if you're not using it. Or to add the provider copied from the corresponding artifact.

If you don't directly depend on this artifact or its parent dependencies, you can let those remain on the --classpath and get resolved as an unnamed module for your application.

Long term solve

An ideal way would be to report this to the maintainers and getting it resolved. It depends though on how actively are they maintaining it e.g. the last release for xalan was almost 5 years back, might just want to look for an actively participated alternative in my opinion.

Boisvert answered 14/2, 2019 at 3:51 Comment(2)
I would suggest a further read of Services section from The State of the Module system to get to know the way its resolved.Boisvert
i had the same issue , i downgraded to 1.8Dibranchiate
S
0

I tried to install update for TestNG in eclipse: "Help -> Check for updates -> deselect all and select TestNG check box. Then
install latest version i installed the version which starts with 7.2.0.

It fixed the issue for me.

Saxhorn answered 19/3, 2020 at 1:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.