-
1. Re: dump jar paths in ModuleClassLoader
zhurlik Feb 10, 2020 1:28 AM (in response to basinilya1)Hi,
I guess it could help you ModuleClassLoader : How can I retrieve the classpath from the loader
Thanks,
Vlad
-
2. Re: dump jar paths in ModuleClassLoader
basinilya1 Feb 10, 2020 3:19 PM (in response to zhurlik)The problem with calling getResources() is it recursively scans parent classloaders and you can't tell which resource belongs to which classloader. Isn't there a way to iterate resource-roots and dependencies of modules?
Besides, you have to pass a real folder name to that method, e.g. "/META-INF". Passing just a forward slash works for file:/ resources, but not for jar: resources. Not all jars contain a META-INF folder.
-
3. Re: dump jar paths in ModuleClassLoader
yersan Feb 18, 2020 4:16 AM (in response to basinilya1)1 of 1 people found this helpfulI haven't found either a way to get this information directly via JBoss Modules API.
Just in case it could help you somehow, via CLI there are a couple of operations that can be used to get information related, probably they won't fit at all on your use case, but, they could be useful to understand the classpath of your deployed application.
- Since WF16, you can list the JBoss Modules modules the server has added to your deployed application, see Developer Guide
- Via CLI, there is also an operation that can list root resources a JBoss Modules module has. It is deprecated because it was added as an experimental feature but it can still be used to get some information. This operation is also available via JMX (MBeans->jboss.as->module-loading -> operations on the jconsole)
[standalone@localhost:9990 /] /core-service=module-loading:list-resource-loader-paths(module=io.undertow.core) { "outcome" => "success", "response-headers" => {"warnings" => [{ "warning" => "WFLYCTL0449: Operation list-resource-loader-paths against the resource at address /core-service=module-loading is deprecated, and it might be removed in future version. See the the output of the read-operation-description operation to learn more about the deprecation.", "level" => "WARNING", "operation" => { "address" => [("core-service" => "module-loading")], "operation" => "list-resource-loader-paths" } }]}, "result" => [ "/wildfly/dist/target/wildfly-19.0.0.Beta2-SNAPSHOT/modules/system/layers/base/io/undertow/core/main/undertow-core-2.0.29.Final.jar", "/wildfly/dist/target/wildfly-19.0.0.Beta2-SNAPSHOT/modules/system/layers/base/io/undertow/core/main/lib" ] }
-
-
5. Re: dump jar paths in ModuleClassLoader
ctomc Feb 18, 2020 6:24 AM (in response to yersan)yersan wrote:
- Via CLI, there is also an operation that can list root resources a JBoss Modules module has. It is deprecated because it was added as an experimental feature but it can still be used to get some information.
It was initially added as deprecated as it was using reflection to get jboss modules internals to display this data. But given that is now using public JMX api from jboss-modules, operation as such could be un-deprecated, wdyt?
-
6. Re: dump jar paths in ModuleClassLoader
yersan Feb 18, 2020 10:20 AM (in response to ctomc)Hey ctomc
The public JMX api is not available outside of the JMX world and the deprecation is also related to whether the internal functionality is fully supported on EAP. It seems is not so easy to un-deprecate the CLI use of this operation without an strong case supporting it.
-
7. Re: dump jar paths in ModuleClassLoader
ctomc Feb 19, 2020 4:58 AM (in response to yersan)JMX api can be access from outside world (remote jmx, jconsole, ...) which makes it de facto public api.
And as such is "full supporteded" at least the jboss-modules part of the api
Wildfly side is as you said, different.