deepstreamIO / deepstream.io-client-java

The Java/Android Client for deepstream.io
Other
35 stars 37 forks source link

NPE on record.setWithAck() #117

Open mhball opened 7 years ago

mhball commented 7 years ago

I'm getting a null pointer when using record.setWithAck()

Using the following code snippets:

this.client = new DeepstreamClient(dsUrl);

Record record = client.record.getRecord(dataPacket.getSchemaKey() + "/" +metaData.getInstanceUrn());
record.setWithAck(gson.toJsonTree(toStore));

The record is being set; however I get the following exception:

Exception in thread "pool-13-thread-1" java.lang.NullPointerException
    at io.deepstream.UtilSingleNotifier.recieve(UtilSingleNotifier.java:133)
    at io.deepstream.RecordHandler.handle(RecordHandler.java:497)
    at io.deepstream.Connection$4.run(Connection.java:230)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

This exception isn't thrown if I switch it to record.set(gson.toJsonTree(toStore)); instead.

Arnovsky commented 5 years ago

@mhball Hi, have you found any solution to this issue? Is there any branch of the library that fixes this?

mhball commented 5 years ago

@TripleSnipe Unfortunately we never found a solution and ended up moving away from Deepstream.io

afiller commented 3 years ago

@mhball / @Arnovsky I think I found a solution. Send me a message if it's still relevant for you.