Caught "NullPointerException": null

Hello,

I am running into a strange problem with one of my workflows. I am doing some (> 20k) requests at NCBI using the GET Resource node. The response is saved as a XML file using the XML Writer node.

Workflow design

Everything is wrapped into two loops: Loop 1 starts with a Chunk Loop Start node and ends with a crude Loop End node just to perform one request at a time. Loop 2 (inner loop) starts with a Generic Loop Start node and ends with a Variable Condition Loop End node.

The reason for the inner loop is, to catch all fails caused by the GET Resource node and retry until a certain limit is reached.

Failure

Now suddenly after a few hundred loops the workflow fails. Error 1 is caused by the Variable Condition Loop End node:

ERROR     Variable Condition Loop End        Execute failed: Input table's structure differs from reference (first iteration) table: different column counts 1 vs. 0

At this point I can tell you that the preceding nodes outport delivers a table with one column and one row. Cell type is XML.

Error 2 is caused by the XML Writer node:

ERROR     XML Writer                         Execute failed: ("NullPointerException"): null

Last but not least three more errors can be found in the console:

ERROR     XMLCellContent                     Error while parsing XML in XML Cell
ERROR     LocalNodeExecutionJob              Caught "NullPointerException": null
ERROR     LocalNodeExecutionJob              Caught "NullPointerException": null

Confusion

Apart from the fact, that error 1 makes no sense to me, I can pull an additional XML Writer node into the failed/cancelled workflow and connect it to the same outport as the original XML Writer node. Now when executing this node, everything is fine, no errors occure...

A screenshot is attached to this post, I hope it helps to understand the problem.

Best,
Marc

Hi Marc, 

Loop end nodes need to have the same table spec for each iteration and I think your loop is failing becuase there is no XML column in your Table Creator.  I believe you will need to fix this in order to proceed ("String to XML" should solve that problem).

As for the XML writer, that indeed looks a bit weird.  Once we get the loop working, let's try to diagnose that.  One last pointl your java edit variable node will only be executed once.  If that isn't deliberate, you may want to use a variable connection to inject the appropriate dependency.

Cheers,

Aaron 

Hey Aaron,

thank you for your answer! Here are some more comments:

I just added the String To XML node between the Table Creator and the Catch Errors node. I thought it wasn't necessary because the (inner) loop will be repeated until the incoming table is NOT empty.

The purpose of the Java Edit Variable node is to create a flow variable called FailingNode and assign the string "none" to this variable. This is because I use this variable to quit the inner loop if no errors occure.

While typing these lines the workflow crashed again. Same problem with the XML Writer node!

Best,
Marc

Hey Aaron,

thank you for your answer! Here are some more comments:

I just added the String To XML node between the Table Creator and the Catch Errors node. I thought it wasn't necessary because the (inner) loop will be repeated until the incoming table is NOT empty.

The purpose of the Java Edit Variable node is to create a flow variable called FailingNode and assign the string "none" to this variable. This is because I use this variable to quit the inner loop if no errors occure.

While typing these lines the workflow crashed again. Same problem with the XML Writer node!

Best,
Marc