Java 11无法派生模块描述符 [英] Java 11 Unable to derive module descriptor

查看:746
本文介绍了Java 11无法派生模块描述符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试编译新的模块化Java 11应用程序时,我收到此错误消息:

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.

我正在使用openjdk 11.0.2,IntelliJ 2018.3.4,Maven

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.

推荐答案

我在

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.

只是为了解释导致代码中问题的原因,我将分享一个屏幕截图,然后尝试在其周围添加详细信息.

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

因此,在2.7.2版的JAR中,有服务声明(META-INF/services),其中包括org.apache.xalan.extensions.bsf.BSFManager作为其中之一.这里的服务文件必须为其本身指示提供者,并且应该解析该类(模块路径或未命名模块)以进行可靠的模块配置.

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(modulepath or unnamed module) to be resolved for reliable configuration of modules.

在这种情况下,对于模块xalan(自动模块),列出的服务在依赖项本身中未打包提供程序类. (请参见软件包org.apache,因此它不再具有软件包bsf和类BSFManager.因此,您将获得一个例外.

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.

要解决的一项调整措施就是更新库jar(修补它)并在不使用服务文件的情况下摆脱它.

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.

一种理想的方式是将其报告给维护人员,如果他们正在积极维护它(最新版本已经将近5年了,可能只想寻找更好的替代恕我直言).

An ideal way would be reporting this to the maintainers and getting it resolved if they are actively maintaining it (the last release was almost 5 years back, might just want to look for a better alternative IMHO).

这篇关于Java 11无法派生模块描述符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆