REST POST fails with NullPointerException against some env. but fine against another

Hey, K-REST gurus,

I am using KREST1 that comes with new install of KNIME 2.11.03.

My first request is POST request to authenticate. It works fine against one environment but fails against 2 other environments with NullPointerException. All environments are essentially host the same RESTful app server, just with different underlying users and data.

I added REST logging but it shows valid request being sent to the server although the response is never received. I tested the same URL with auth data using Chrome Postman extension - works fine. Wrote small console app in C# that runs against the problematic environment - works fine.

Here is what I found in knime.log:

2015-05-06 17:46:44,041 ERROR KNIME-Worker-49 POST Resource : Execute failed: ("NullPointerException"): null
2015-05-06 17:46:44,041 DEBUG KNIME-Worker-49 POST Resource : Execute failed: ("NullPointerException"): null
java.lang.NullPointerException
    at com.cenix.krest.nodes.submitter.single.SingleResponseHandler.getDataFormatForResponse(SingleResponseHandler.java:312)
    at com.cenix.krest.nodes.submitter.single.SingleResponseHandler.<init>(SingleResponseHandler.java:75)
    at com.cenix.krest.nodes.submitter.single.SingleRestNodeModel.processResponse(SingleRestNodeModel.java:230)
    at com.cenix.krest.nodes.submitter.single.SingleRestNodeModel.execute(SingleRestNodeModel.java:215)
    at org.knime.core.node.NodeModel.execute(NodeModel.java:706)
    at org.knime.core.node.NodeModel.executeModel(NodeModel.java:555)
    at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1131)
    at org.knime.core.node.Node.execute(Node.java:927)
    at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:559)
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
    at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
    at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
    at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:328)
    at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:204)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:125)
    at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:248)
2015-05-06 17:46:44,057 DEBUG KNIME-Worker-49 WorkflowManager : POST Resource 0:15 doBeforePostExecution
2015-05-06 17:46:44,057 DEBUG KNIME-Worker-49 NodeContainer : POST Resource 0:15 has new state: POSTEXECUTE
2015-05-06 17:46:44,057 DEBUG KNIME-Worker-49 WorkflowManager : POST Resource 0:15 doAfterExecute - failure
2015-05-06 17:46:44,057 DEBUG KNIME-Worker-49 POST Resource : reset

What could it be? This drives me crazy...

Any help is greatly appreciated.

Thanks,

Leo

Leo,

It could be the same problem I encountered a while back (see https://tech.knime.org/forum/krest-nodes/nullpointerexception-in-post-resource ).

There the problem was that in some cases the response did not have any content (this is by design, and  a perfectly normal response). The KREST1 code does not handle this case correctly.

So you could check the HTTP headers that your service gives back and check what it returns.

Tim

PS: Are there any  KREST developers still active in the KNIME community?

Tim,

I was expecting to get notification on any update in this forum but apparently none arrived. This is why I saw your response only now.

The situation became even worse - I slightly changed the flow and now the same POST request with the same data fails. This time with another error:

2015-05-14 17:06:46,395 DEBUG KNIME-Worker-33 POST Resource : Execute failed: ("ArrayIndexOutOfBoundsException"): null
java.lang.ArrayIndexOutOfBoundsException
2015-05-14 17:06:46,395 DEBUG KNIME-Worker-33 WorkflowManager : POST Resource 2:15 doBeforePostExecution
2015-05-14 17:06:46,395 DEBUG KNIME-Worker-33 NodeContainer : POST Resource 2:15 has new state: POSTEXECUTE
2015-05-14 17:06:46,395 DEBUG KNIME-Worker-33 WorkflowManager : POST Resource 2:15 doAfterExecute - failure

From your older post it seems that KREST2 should better handle these situations but I have no idea from where to download and how to install.

Any further suggestions are greatly appreciated.

Thanks, Leo

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.