Skip to content

NPE in JBossClassLoaderHandler#findClasspathOrder  #651

@arthware

Description

@arthware

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.

final Map<Object, Object> moduleMap = (Map<Object, Object>) ReflectionUtils.getFieldVal(false,
callerModuleLoader, "moduleMap");
for (final Entry<Object, Object> ent : moduleMap.entrySet()) {

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) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions