question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPE in JBossClassLoaderHandler#findClasspathOrder

See original GitHub issue

In our scenario we get a NullPointerException in JBossClassLoaderHandler#findClasspathOrder

The moduleMap is null in our case, leading to an NPE in the next line, when accessing the entrySet.

https://github.com/classgraph/classgraph/blob/f874380e58ac3e9e4834df199129a58c79d15f33/src/main/java/nonapi/io/github/classgraph/classloaderhandler/JBossClassLoaderHandler.java#L213-L215

I was able to fix this with a simple null check. The scan returns the expected results.

Before: for (final Entry<Object, Object> ent : moduleMap.entrySet() ) {

After: Set<Entry<Object, Object>> moduleMapEntries = moduleMap != null ? moduleMap.entrySet() : Collections.emptySet(); for (final Entry<Object, Object> ent : moduleMapEntries) {

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arthwarecommented, Feb 17, 2022

Thank you for merging and your efforts!

0reactions
lukehutchcommented, Feb 24, 2022

OK, I was able to push out version 4.8.140 with this fix. I probably should have just done this after merging. Thanks again for your fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 6. JBoss EAP Class Loading - Red Hat Customer Portal
The modular class loader separates all Java classes into logical groups called modules. Each module can define dependencies on other modules in order...
Read more >
Manipulating class-path order jboss-deployment-structure.xml
In JBoss AS 6 the classpath of the jars contained within the deployment can be directly manipulated using the jboss-structure. xml file, ...
Read more >
Spring Boot Reference Documentation
Check the spring.io web-site for a wealth of reference documentation. ... To do so, include the appropriate spring-boot-*.jar files on your classpath.
Read more >
Reverse classload order on a Java thread - Stack Overflow
You can try creating your own customer class loader to do the look up in reverse order from the class path and set...
Read more >
jBPM Documentation - Index of /
For other task types, including all custom tasks, when the task must be executed the jBPM engine executes a call using the Work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found