ClassCastException during scan when classgraph is shaded
See original GitHub issueThis seems to be related to scanning modules but I don’t have any experience with them so I am at a bit of a loss of what the correct solution might entail. In a nutshell there are two orbit modules which shade classgraph to different packages, then when scanning a class cast exception is thrown as seen below.
Caused by: java.lang.ClassCastException: class cloud.orbit.runtime.shaded.io.github.classgraph.ModuleRef cannot be cast to class cloud.orbit.core.shaded.io.github.classgraph.ModuleRef (cloud.orbit.runtime.shaded.io.github.classgraph.ModuleRef and cloud.orbit.core.shaded.io.github.classgraph.ModuleRef are in unnamed module of loader 'app')
at cloud.orbit.core.shaded.io.github.classgraph.Scanner.<init>(Scanner.java:169)
at cloud.orbit.core.shaded.io.github.classgraph.ClassGraph.scanAsync(ClassGraph.java:1125)
at cloud.orbit.core.shaded.io.github.classgraph.ClassGraph.scan(ClassGraph.java:1161)
at cloud.orbit.core.shaded.io.github.classgraph.ClassGraph.scan(ClassGraph.java:1201)
at cloud.orbit.core.shaded.io.github.classgraph.ClassGraph.scan(ClassGraph.java:1214)
at cloud.orbit.actors.runtime.ClassPathSearch.<init>(ClassPathSearch.java:123)
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
ClassCastException during scanning (Java 11) - SonarQube
I encountered an error during scanning of my Java 11 source code. I created a snippet which recreates the same issue. Stuff I'm...
Read more >ClassCastException because of different classloaders
Hello, In some place of my plugin I try to get class declared in a file by this way: class MyCustomTestContributor:...
Read more >ClassGraph (ClassGraph 4.8.17 API) - javadoc.io
Uber-fast, ultra-lightweight Java classpath and module path scanner. Scans classfiles in the classpath and/or module path by parsing the classfile binary ...
Read more >JRebel Changelog | JRebel & XRebel by Perforce
The JRebel Changelog shows the latest changes introduced in JRebel releases, ... Bug fix: fixed an integration issue when shaded Byte Buddy is...
Read more >ClassCastException when trying to parse a JSONArray
class cast failures. Solution: Look at the web container file tree on your execution platform to find multiple copies of the JSON JAR...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lukehutch sorry for the smoke, hope you don’t mind that I created a small wiki page in an effort to help others who may need to shade ClassGraph.
https://github.com/classgraph/classgraph/wiki/Shading-ClassGraph
Great, thanks for the contribution! I’ll link that page from the build instructions.