Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBoss EAP 7.4.15 class loading issue on EJB Modules #843

Open
DJay89 opened this issue Apr 4, 2024 · 3 comments
Open

JBoss EAP 7.4.15 class loading issue on EJB Modules #843

DJay89 opened this issue Apr 4, 2024 · 3 comments

Comments

@DJay89
Copy link

DJay89 commented Apr 4, 2024

JBoss EAP 7.4.15 have removed duplicated .jar files in the virtual filesystem, which affects classgraph scanning.
See the following cases for more information:
https://issues.redhat.com/browse/JBEAP-25677
https://issues.redhat.com/browse/JBEAP-25881
As a result, custom EJB Modules can no longer be scanned with classgraph.

By the looks of it, the issue lies here:
https://github.com/classgraph/classgraph/blob/latest/src/main/java/nonapi/io/github/classgraph/classloaderhandler/JBossClassLoaderHandler.java#L116

Where "(File) classpathOrderOut.reflectionUtils.invokeMethod(false, root, getPhysicalFile")" returns
"/usr/jboss-eap-7.4/standalone/tmp/vfs/deployment/deploymentc5c5d28878f37435/my-custom-module.jar-b6085cefd724c425/contents"

And final File file = new File(physicalFile.getParentFile(), name) resolves to:
"/usr/jboss-eap-7.4/standalone/tmp/vfs/deployment/deploymentc5c5d28878f37435/my-custom-module.jar-b6085cefd724c425/my-custom-module.jar".

Notice the file path, where the duplicated module have been deleted. It can no longer be found at that location.

@lukehutch
Copy link
Member

What is your proposed fix? I know nothing about JBoss.

@DJay89
Copy link
Author

DJay89 commented Apr 5, 2024

I've observed that org.reflections are using org.jboss.vfs.VirtualFile, so I would assume using the same dependency could help in resolving the issue. Here's a link: https://github.com/jbossas/jboss-vfs

And here's how org.reflections are using this dependency:
https://github.com/ronmamo/reflections/blob/master/src/main/java/org/reflections/vfs/JbossDir.java#L41

@lukehutch
Copy link
Member

I would need a PR to fix this, since I don't even know how to run JBoss code. See how the existing support is implemented, and see if you can extend it:

https://github.com/classgraph/classgraph/blob/latest/src/main/java/nonapi/io/github/classgraph/classloaderhandler/JBossClassLoaderHandler.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants