ModuleFinder can't find one module
Alex Orlov
ooo_saturn7 at mail.ru
Tue Jan 31 12:52:26 UTC 2023
Hello,
I create JPMS layer with module finder dynamically. Moving from jetty 10 to jetty 11 I came across a situation that
module finder can’t find existing(!) module. It finds the following modules:
/home/alex/Server/bin/./../repo/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar
/home/alex/Server/bin/./../repo/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar
/home/alex/Server/bin/./../repo/com/sun/activation/jakarta.activation/1.2.1/jakarta.activation-1.2.1.jar
/home/alex/Server/bin/./../repo/com/sun/istack/istack-commons-runtime/4.0.1/istack-commons-runtime-4.0.1.jar
/home/alex/Server/bin/./../repo/com/sun/xml/bind/jaxb-impl/2.3.2/jaxb-impl-2.3.2.jar
/home/alex/Server/bin/./../repo/io/github/classgraph/classgraph/4.6.18/classgraph-4.6.18.jar
/home/alex/Server/bin/./../repo/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar
/home/alex/Server/bin/./../repo/jakarta/servlet/jakarta.servlet-api/5.0.0/jakarta.servlet-api-5.0.0.jar
/home/alex/Server/bin/./../repo/jakarta/servlet/jsp/jstl/jakarta.servlet.jsp.jstl-api/2.0.0/jakarta.servlet.jsp.jstl-api-2.0.0.jar
/home/alex/Server/bin/./../repo/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar
/home/alex/Server/bin/./../repo/jakarta/ws/rs/jakarta.ws.rs-api/2.1.6/jakarta.ws.rs-api-2.1.6.jar
/home/alex/Server/bin/./../repo/jakarta/xml/bind/jakarta.xml.bind-api/2.3.2/jakarta.xml.bind-api-2.3.2.jar
/home/alex/Server/bin/./../repo/javax/enterprise/cdi-api/1.1/cdi-api-1.1.jar
/home/alex/Server/bin/./../repo/org/eclipse/jdt/ecj/3.27.0/ecj-3.27.0.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/apache-jsp/11.0.13/apache-jsp-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-annotations/11.0.13/jetty-annotations-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-http/11.0.13/jetty-http-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-io/11.0.13/jetty-io-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-jndi/11.0.13/jetty-jndi-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-plus/11.0.13/jetty-plus-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-security/11.0.13/jetty-security-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-server/11.0.13/jetty-server-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-servlet/11.0.13/jetty-servlet-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-servlets/11.0.13/jetty-servlets-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-util/11.0.13/jetty-util-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-webapp/11.0.13/jetty-webapp-11.0.13.jar
/home/alex/Server/bin/./../repo/org/eclipse/jetty/jetty-xml/11.0.13/jetty-xml-11.0.13.jar
/home/alex/Server/bin/./../repo/org/glassfish/hk2/external/jakarta.inject/2.6.1/jakarta.inject-2.6.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/hk2/hk2-api/2.6.1/hk2-api-2.6.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/hk2/hk2-locator/2.6.1/hk2-locator-2.6.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/hk2/hk2-utils/2.6.1/hk2-utils-2.6.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/hk2/spring-bridge/2.6.1/spring-bridge-2.6.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/jersey/containers/jersey-container-jetty-http/2.30.1/jersey-container-jetty-http-2.30.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/jersey/containers/jersey-container-servlet-core/2.30.1/jersey-container-servlet-core-2.30.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/jersey/core/jersey-client/2.30.1/jersey-client-2.30.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/jersey/core/jersey-common/2.30.1/jersey-common-2.30.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/jersey/core/jersey-server/2.30.1/jersey-server-2.30.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/jersey/ext/cdi/jersey-cdi1x-servlet/2.30.1/jersey-cdi1x-servlet-2.30.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/jersey/ext/cdi/jersey-cdi1x/2.30.1/jersey-cdi1x-2.30.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/jersey/ext/jersey-bean-validation/2.30.1/jersey-bean-validation-2.30.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/jersey/ext/jersey-spring5/2.30.1/jersey-spring5-2.30.1.jar
/home/alex/Server/bin/./../repo/org/glassfish/jersey/inject/jersey-hk2/2.30.1/jersey-hk2-2.30.1.jar
/home/alex/Server/bin/./../repo/org/javassist/javassist/3.27.0-GA/javassist-3.27.0-GA.jar
/home/alex/Server/bin/./../repo/org/mortbay/jasper/apache-el/10.0.14/apache-el-10.0.14.jar
/home/alex/Server/bin/./../repo/org/mortbay/jasper/apache-jsp/10.0.14/apache-jsp-10.0.14.jar
/home/alex/Server/bin/./../repo/org/ow2/asm/asm-analysis/9.4/asm-analysis-9.4.jar
/home/alex/Server/bin/./../repo/org/ow2/asm/asm-commons/9.4/asm-commons-9.4.jar
/home/alex/Server/bin/./../repo/org/ow2/asm/asm-tree/9.4/asm-tree-9.4.jar
/home/alex/Server/bin/./../repo/org/ow2/asm/asm/9.4/asm-9.4.jar
/home/alex/Server/bin/./../repo/org/springframework/spring-aop/6.0.4/spring-aop-6.0.4.jar
/home/alex/Server/bin/./../repo/org/springframework/spring-beans/6.0.4/spring-beans-6.0.4.jar
/home/alex/Server/bin/./../repo/org/springframework/spring-context/6.0.4/spring-context-6.0.4.jar
/home/alex/Server/bin/./../repo/org/springframework/spring-core/6.0.4/spring-core-6.0.4.jar
/home/alex/Server/bin/./../repo/org/springframework/spring-expression/6.0.4/spring-expression-6.0.4.jar
/home/alex/Server/bin/./../repo/org/springframework/spring-web/6.0.4/spring-web-6.0.4.jar
/home/alex/Server/bin/./../repo/org/springframework/spring-webmvc/6.0.4/spring-webmvc-6.0.4.jar
but it can’t find the JSTL implementation module: /home/alex/Server/bin/./../repo/org/glassfish/web/jakarta.servlet.jsp.jstl/2.0.0/jakarta.servlet.jsp.jstl-2.0.0.jar
At the same time path is correct, when I do:
cat /home/alex/Server/bin/./../repo/org/glassfish/web/jakarta.servlet.jsp.jstl/2.0.0/jakarta.servlet.jsp.jstl-2.0.0.jar
I see the binary code on my console. So, path is correct.
To create module finder I do:
ModuleFinder jarModuleFinder = ModuleFinder.of(jarModulePaths.toArray(new Path[jarModulePaths.size()]));
To check found modules I do:
final Set<String> foundModulePaths = new HashSet<>();
for (ModuleReference reference : moduleFinder.findAll()) {
var path = reference.location().get().getPath();
foundModulePaths.add(path); }
So, as result jarModulePaths.size() = foundModulePaths.size() + 1. I mean that one module is not found.
Could anyone say why module finder can’t find existing module. Is the problem in module, jdk or my code?
--
Best regards, Alex Orlov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jigsaw-dev/attachments/20230131/b82fdf7b/attachment.htm>
More information about the jigsaw-dev
mailing list