Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.5
-
None
Description
When trying to execute PGEs using the latest trunk build of CAS-PGE (r1460925), I keep getting NullPointerExceptions when a batchstub (or Workflow Manager locally) tries to execute PgeTaskInstance's run() method.
After some investigation, it seems that the NullPointerException is being generated by the use of the 'logger' object at line 139 of PgeTaskInstance.java [1].
See the following error example of running a simple PGE workflow:
...
INFO: Executing task: [Determine_Snow_Density_Task] locally
java.lang.NullPointerException
at org.apache.oodt.cas.pge.PGETaskInstance.run(PGETaskInstance.java:139)
at org.apache.oodt.cas.workflow.engine.IterativeWorkflowProcessorThread.executeTaskLocally(IterativeWorkflowProcessorThread.java:573)
at org.apache.oodt.cas.workflow.engine.IterativeWorkflowProcessorThread.run(IterativeWorkflowProcessorThread.java:320)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:680)
Mar 25, 2013 10:41:26 AM org.apache.oodt.cas.workflow.engine.IterativeWorkflowProcessorThread executeTaskLocally
WARNING: Exception executing task: [Determine_Snow_Density_Task] locally: Message: null
Looking at the code of PGETaskInstance.java [1], it appears that the 'logger' object is used multiple times before it is instantiated. For example, methods like createPgeMetadata and createPgeConfig both use the 'logger' object before the method createLogger() has been invoked. This generates a NullPointerException, which is then caught by the run() method's catch block. The catch statement then tries to log the error, but then runs into a second NullPointerException because logger has still not been instantiated.
This is a major issue, because not only does initialization of a PGE immediately stop, but any erroneous configuration of PGEs is not properly logged and alerted to the user.