cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Stream.AddStreamEntries produces null pointer exception

SOLVED
Highlighted
Amethyst

Stream.AddStreamEntries produces null pointer exception

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 */
});

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Stream.AddStreamEntries produces null pointer exception

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. 

View solution in original post

2 REPLIES 2
Highlighted

Re: Stream.AddStreamEntries produces null pointer exception

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.

Highlighted

Re: Stream.AddStreamEntries produces null pointer exception

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. 

View solution in original post

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!