MeltwaterArchive / datasift-java

Java client to interface with DataSift
http://www.datasift.com/
MIT License
10 stars 7 forks source link

Exception when subscribing to a stream using v3.2.0 or v3.2.1 #79

Closed dugjason closed 9 years ago

dugjason commented 9 years ago

From discussion topic at https://support.datasift.com/hc/communities/public/questions/202596207-Exception-when-subscribing-to-a-stream-using-v3-2-0-or-v3-2-1:

Further to the issue "Streaming Exception - Connection timed out", I upgraded from v3.1.1 to v3.2.1 this morning and am getting the following when attempting to subscribe to a stream:-

com.datasift.client.stream.DataSiftConnection 11:09:36,953  WARN DataSiftConnection:179 - Failed to connect to DataSift, if enabled, client will reconnect
java.lang.NullPointerException
    at com.datasift.client.stream.DataSiftConnection.connect(DataSiftConnection.java:174)
    at com.datasift.client.stream.DataSiftConnection.<init>(DataSiftConnection.java:55)
    at com.datasift.client.stream.ConnectionManager.subscribe(ConnectionManager.java:139)
    at uk.co.insidertech.examples.DataSiftStream.main(DataSiftStream.java:73)
com.datasift.client.stream.DataSiftConnection 11:09:38,967  WARN DataSiftConnection:179 - Failed to connect to DataSift, if enabled, client will reconnect
java.lang.NullPointerException
    at com.datasift.client.stream.DataSiftConnection.connect(DataSiftConnection.java:174)
    at com.datasift.client.stream.DataSiftConnection.connect(DataSiftConnection.java:181)
    at com.datasift.client.stream.DataSiftConnection.<init>(DataSiftConnection.java:55)
    at com.datasift.client.stream.ConnectionManager.subscribe(ConnectionManager.java:139)
    at uk.co.insidertech.examples.DataSiftStream.main(DataSiftStream.java:73)
com.datasift.client.stream.DataSiftConnection 11:09:42,974  WARN DataSiftConnection:179 - Failed to connect to DataSift, if enabled, client will reconnect
java.lang.NullPointerException
    at com.datasift.client.stream.DataSiftConnection.connect(DataSiftConnection.java:174)
    at com.datasift.client.stream.DataSiftConnection.connect(DataSiftConnection.java:181)
    at com.datasift.client.stream.DataSiftConnection.connect(DataSiftConnection.java:181)
    at com.datasift.client.stream.DataSiftConnection.<init>(DataSiftConnection.java:55)
    at com.datasift.client.stream.ConnectionManager.subscribe(ConnectionManager.java:139)
    at uk.co.insidertech.examples.DataSiftStream.main(DataSiftStream.java:73)

Test program:-

DataSiftConfig config = new DataSiftConfig("*******", "***********************************");
DataSiftClient datasift = new DataSiftClient(config);
String csdl = "twitter.user.screen_name == \"****\"";
Stream stream = datasift.compile(csdl).sync();

datasift.liveStream().onError(new ErrorHandler()); // handles stream errors
datasift.liveStream().onStreamEvent(new DeleteHandler()); // handles data deletes

datasift.liveStream().subscribe(new Subscription(stream));

I have gone back to v3.1.1 and this works.

zcourts commented 9 years ago

fixed in https://github.com/datasift/datasift-java/releases/tag/datasift-java-3.2.2