Itiviti / simple-slack-api

(simple) Java Slack client library
470 stars 193 forks source link

ERROR com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl - javax.websocket.DeploymentException: Handshake response not received #62

Open NarendraDRR opened 8 years ago

NarendraDRR commented 8 years ago

Hi, I am getting the below error while executing the "SlackDirectConnection.java"

ERROR com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl - javax.websocket.DeploymentException: Handshake response not received. Exception in thread "main" java.lang.NullPointerException at com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl.openDirectMessageChannel(SlackWebSocketSessionImpl.java:569) at com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl.getIMChannelForUser(SlackWebSocketSessionImpl.java:123) at com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl.sendMessageToUser(SlackWebSocketSessionImpl.java:96) at actions.SendingMessages.sendDirectMessageToAUser(SendingMessages.java:37) at com.ullink.slack.simpleslackapi.samples.connection.SlackDirectConnection.main(SlackDirectConnection.java:22)

Please let us know how to resolve this. Thanks in Advance.

bcorne commented 8 years ago

Hi,

According to the stacktrace, it looks like the user you're passing to sendMessageToUser is null.

Could you check that part?

Best regards,

Benoit

NarendraDRR commented 8 years ago

Hi Benoit,

Thanks a lot your support. Now we are able to send message to the direct user or specific channel. But end of the session/execution we are getting the following exception: "[main] ERROR com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl - javax.websocket.DeploymentException: Handshake response not received." Could please suggest how to avoid this exception.

And we have to send message with attachment to the user/channel we have tried to pass attachment/file path in the following way, but the image/attachment is not delivered to user. Only message is delivering to user. SlackAttachment attachment =new SlackAttachment(); attachment.thumb_url="/Users/Desktop/SlackJars.png"; SendingMessages s =new SendingMessages(); s.sendDirectMessageToAUser(session,"jay","Hi, How are you?",attachment); Please let us know how to pass image url. Thanks in Advance.