JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report JPPF-116  -  NPE in AbstractJPPFClassLoader.findResources()
Posted Jan 16, 2013 - updated Dec 27, 2014
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Bug report
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Progress
       
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Node
  • Resolution
    RESOLVED
  • Priority
    High
  • Reproducability
    Always
  • Severity
    Normal
  • Targetted for
    icon_milestones.png JPPF 3.3
Issue description
When trying to get, for the second time, a resource that does not exist in the class path via getResources(String name), the following stack is raised:
java.lang.NullPointerException
  at org.jppf.classloader.AbstractJPPFClassLoader.findResources(AbstractJPPFClassLoader.java:284)
  at java.lang.ClassLoader.getResources(ClassLoader.java:1176)
  at java.lang.ClassLoader.getResources(ClassLoader.java:1172)
  at test.oome.OOMEJobTask.run(OOMEJobTask.java:66)
  at org.jppf.server.node.NodeTaskWrapper.run(NodeTaskWrapper.java:132)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
  at java.util.concurrent.FutureTask.run(FutureTask.java:166)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
  at java.lang.Thread.run(Thread.java:722)
This is due to improper handling of the list of URls in AbstractJPPFClassLoader.findResources(), which can be null when the resource name is found in the "not found resource" cache.
Steps to reproduce this issue
1) Using the following task:
public class MyTask extends JPPFTask {
  @Override
  public void run() {
    try {
      Enumeration<URL> res = getClass().getClassLoader().getResources("some_dummy_resource.dfg");
      System.out.println("found resources: " + res);
    } catch(Exception e) {
      setException(e);
    }
  }
}
2) Submit 2 jobs in sequence, each with a single task as defined above

==> upon completion of the 2nd, you can see the NPE set onto the JPPFTask.getException()

#7
Comment posted by
 lolo4j
Jan 16, 09:05
Fixed. Changes committed to SVN:

The issue was updated with the following change(s):
  • This issue has been closed
  • The status has been updated, from Confirmed to Closed.
  • This issue's progression has been updated to 100 percent completed.
  • The resolution has been updated, from Not determined to RESOLVED.
  • Information about the user working on this issue has been changed, from lolo4j to Not being worked on.