NullPointerException in org.jboss.modules.JDKSpecific.getPackage(JDKSpecific.java:135) in JBoss EAP 7

Solution Unverified - Updated -

Issue

  • We are seeing a NullPointerException in org.jboss.modules.JDKSpecific.getPackage(JDKSpecific.java:135) in JBoss EAP 7 when our application calls Package.getPackages()
    for(Package p : Package.getPackages())
      log.info("AnyClass package: " + p);
ERROR [stderr] (ServerService Thread Pool -- 62) java.lang.NullPointerException
ERROR [stderr] (ServerService Thread Pool -- 62)  at org.jboss.modules.JDKSpecific.getPackage(JDKSpecific.java:135)
ERROR [stderr] (ServerService Thread Pool -- 62)  at org.jboss.modules.ClassLoaderLocalLoader.loadPackageLocal(ClassLoaderLocalLoader.java:64)
ERROR [stderr] (ServerService Thread Pool -- 62)  at org.jboss.modules.Module.getPackages(Module.java:1678)
ERROR [stderr] (ServerService Thread Pool -- 62)  at org.jboss.modules.ModuleClassLoader.getPackages(ModuleClassLoader.java:662)
ERROR [stderr] (ServerService Thread Pool -- 62)  at java.lang.Package.getPackages(Package.java:304)
ERROR [stderr] (ServerService Thread Pool -- 62)  at reproducer.AnyClass.anyMethod(AnyClass.java:10)
ERROR [stderr] (ServerService Thread Pool -- 62)  at reproducer.TestSingleton.test(TestSingleton.java:19)
...

Environment

Red Hat JBoss Enterprise Application Platform (EAP) 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In