Skip to main content
1-Visitor
June 11, 2019
Solved

Stream.AddStreamEntries produces null pointer exception

  • June 11, 2019
  • 2 replies
  • 1370 views

Hello, 

 

I have a stream that I am attempting to add entries to by calling the .AddStreamEntries() method. I have tried passing two different infotables - one whose datashape is identical to the datashape on the stream which I'm trying to edit, and one which is defined by a new datashape, where I added the fields for 'location', 'tags', etc (to match more exactly with all stream fields). 

 

Both methods throw a null pointer exception. I know that the infotable I'm passing it is not empty - already checked that.

 

Any ideas?

 

 

Things["MY_STREAM"].AddStreamEntries({
values: MY_INFO_TABLE /* INFOTABLE */
});

Best answer by ague

If anyone is reading this and looking for an answer, here's the solution:

 

You must pass in a timestamp to the .AddStreamEntries() method (in addition to the values, of course). You do not need to pass in a 'source' nor 'sourceType'  - the service will still work. You actually don't even need to define a datashape for the infotable you pass in - you can just make an object directly. 

2 replies

1-Visitor
June 12, 2019

Hard to say without more details on the Infotable contents you are adding and the Stream datashape. But for sure you need to fill standard parameters of stream: timestamp, sourceType and source.

ague1-VisitorAuthorAnswer
1-Visitor
June 25, 2019

If anyone is reading this and looking for an answer, here's the solution:

 

You must pass in a timestamp to the .AddStreamEntries() method (in addition to the values, of course). You do not need to pass in a 'source' nor 'sourceType'  - the service will still work. You actually don't even need to define a datashape for the infotable you pass in - you can just make an object directly.