Skip to content

NullPointerException on missing Plexus config children in AbstractEarMojo.initializeJbossConfiguration() #513

Description

@elharo

Description

In AbstractEarMojo.java:329-364, multiple calls to jboss.getChild(...) are not null-checked before calling .getValue():

  • Line 329: jboss.getChild(JbossConfiguration.VERSION).getValue() — NPE if <version> missing
  • Lines 334-335: jboss.getChild(JbossConfiguration.SECURITY_DOMAIN).getValue() — NPE if missing
  • Lines 336-337: jboss.getChild(JbossConfiguration.UNAUHTHENTICTED_PRINCIPAL).getValue() — NPE if missing
  • Lines 339-340: jboss.getChild(JbossConfiguration.LOADER_REPOSITORY).getValue() — NPE if missing
  • Lines 349, 351, 363-364: Same pattern

Lines 354-355 of the same method prove that getChild() can return null, as the author already null-checks it for dataSources there. The other 7+ calls are inconsistent and will throw NPE if those config elements are absent.

Expected behavior

Add null checks consistent with the existing dataSources handling pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions