• nnewbold
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I'm trying to build the "JavaClientExample" as described @ http://wiki.developerforce.com/index.php/Getting_Started_with_the_Force.com_Streaming_API

 

I am able to successfully connect to salesforce, but post that I get following error: (Any idea or help will be really appreciated)

Waiting for handshake
2011-10-20 11:29:24.779:INFO:org.cometd.client.BayeuxClient@229902:
java.net.ProtocolException: Unexpected response 401: TransportExchange@21375057=POST//na1.salesforce.com:443/cometd/handshake#7
	at org.cometd.client.BayeuxClient$PublishTransportListener.onProtocolError(BayeuxClient.java:969)
	at org.cometd.client.transport.LongPollingTransport$TransportExchange.onResponseComplete(LongPollingTransport.java:291)
	at org.eclipse.jetty.client.HttpExchange$Listener.onResponseComplete(HttpExchange.java:920)
	at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:263)
	at org.eclipse.jetty.client.HttpConnection$Handler.messageComplete(HttpConnection.java:622)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:862)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
	at org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:269)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:515)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
	at java.lang.Thread.run(Unknown Source)