From charlieloehlrich at gmail.com Fri Jan 27 00:57:31 2023 From: charlieloehlrich at gmail.com (Charlie) Date: Fri, 27 Jan 2023 13:57:31 +1300 Subject: Additional Information for JDK-8299504 Message-ID: An HTML attachment was scrubbed... URL: From ooo_saturn7 at mail.ru Tue Jan 31 12:52:26 2023 From: ooo_saturn7 at mail.ru (=?UTF-8?B?QWxleCBPcmxvdg==?=) Date: Tue, 31 Jan 2023 15:52:26 +0300 Subject: =?UTF-8?B?TW9kdWxlRmluZGVyIGNhbid0IGZpbmQgb25lIG1vZHVsZQ==?= Message-ID: <1675169546.617725335@f191.i.mail.ru> 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 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: From Alan.Bateman at oracle.com Tue Jan 31 13:34:40 2023 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 31 Jan 2023 13:34:40 +0000 Subject: ModuleFinder can't find one module In-Reply-To: <1675169546.617725335@f191.i.mail.ru> References: <1675169546.617725335@f191.i.mail.ru> Message-ID: <62b6237b-a878-6ede-510f-efbe6d9347de@oracle.com> On 31/01/2023 12:52, Alex Orlov wrote: > : > To create module finder I do: > ModuleFinder jarModuleFinder = > ModuleFinder.of(jarModulePaths.toArray(new Path[jarModulePaths.size()])); > To check found modules I do: > final Set foundModulePaths = new HashSet<>(); > for (ModuleReference reference : moduleFinder.findAll()) { > ??????????? var path = reference.location().get().getPath(); > ??????????? foundModulePaths.add(path); > ?} > findAll will find occurrence of all modules so it might be that the module in jakarta.servlet.jsp.jstl-2.0.0.jar has the same name as a module that is one of the preceding elements of the module path. Can you try this: java --module-path /jakarta.servlet.jsp.jstl-2.0.0.jar --list-modules and you should see the module in output. Then change your loop above to print the module names and see if it gets printed. BTW: In the above you are using URI::getPath. That returns the decoded path component of the file URI - you can't reliably use this as a file path, I think the code you want here is Path.of(uri).toString(). -Alan From ooo_saturn7 at mail.ru Tue Jan 31 18:07:54 2023 From: ooo_saturn7 at mail.ru (=?UTF-8?B?QWxleCBPcmxvdg==?=) Date: Tue, 31 Jan 2023 21:07:54 +0300 Subject: =?UTF-8?B?UmU6IE1vZHVsZUZpbmRlciBjYW4ndCBmaW5kIG9uZSBtb2R1bGU=?= In-Reply-To: <62b6237b-a878-6ede-510f-efbe6d9347de@oracle.com> References: <1675169546.617725335@f191.i.mail.ru> <62b6237b-a878-6ede-510f-efbe6d9347de@oracle.com> Message-ID: <1675188474.151303506@f387.i.mail.ru> Thank you for your help. I think we?ve found the problem: https://github.com/eclipse-ee4j/jstl-api/issues/241 ? ? -- Best regards, Alex Orlov ? ? >???????, 31 ?????? 2023, 15:34 +02:00 ?? Alan Bateman : >? >On 31/01/2023 12:52, Alex Orlov wrote: >> : >> To create module finder I do: >> ModuleFinder jarModuleFinder = >> ModuleFinder.of(jarModulePaths.toArray(new Path[jarModulePaths.size()])); >> To check found modules I do: >> final Set foundModulePaths = new HashSet<>(); >> for (ModuleReference reference : moduleFinder.findAll()) { >> ??????????? var path = reference.location().get().getPath(); >> ??????????? foundModulePaths.add(path); >> ?} >> >findAll will find occurrence of all modules so it might be that the >module in jakarta.servlet.jsp.jstl-2.0.0.jar has the same name as a >module that is one of the preceding elements of the module path. Can you >try this: > >java --module-path /jakarta.servlet.jsp.jstl-2.0.0.jar --list-modules > >and you should see the module in output. Then change your loop above to >print the module names and see if it gets printed. > >BTW: In the above you are using URI::getPath. That returns the decoded >path component of the file URI - you can't reliably use this as a file >path, I think the code you want here is Path.of(uri).toString(). > >-Alan ? -------------- next part -------------- An HTML attachment was scrubbed... URL: