• sgurumurthy
  • NEWBIE
  • 25 Points
  • Member since 2011
  • Technical Solution Architect
  • Salesforce

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 12
    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)

 

When JSON support was added in APEX, I was one of those guys who jumped up and down. Started using heavily for one of my integration project and everything was fine and dandy for couple week. Since yesterday, I have been noticing some weired behavior. The first time I noticed it, I thought it was one of those APEX issues I love to call "APEX weirdness" and hoped that it will fix itself (READ: getting fixed without us knowing). That hasn't happened. :(

 

Here is the issue. 

 

My JSON parsing code looks like this:

class SomeApexWrapper {

public static SomeApexWrapper getInstance(String jsonString)

JSONParser parser = JSON.createParser(jsonString);       

SomeApexWrapper w = (SomeApexWrapper) parser.readValueAs(SomeApexWrapper.class);

}

}

 

This code was working fine until two days ago. It stops working If I change any class that uses this class to parse json string. The error I get is "[Source: java.io.StringReader@21363a13; line: 1, column: 1] Don't know the type of the Apex object to deserialize"

 

Just saving the SomeApexWrapper  class again fixes the issue. 

 

Has anyone had/having this issue? Is there a permanent solution for this?

  • November 07, 2011
  • Like
  • 0

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)

 

Hi all!

 

I have a strange and annoying problem with my Force.com site. There is a start page where a user can press a button and pass to another page. From time to time after pressing the button the page refreshes about 1 or 2 minutes and then Authorization Required Page appears. There is no errors in the method for this button because all code is enclosed in try/catch block, so user must see a message if an exceptions is thrown. Of course I try this in debug mode. The problem is this issue is unpredictable and takes place not very often so it's hard to reproduce it. But one time I managed to do this and didn't see any additional messages in Authorization Required Page. May be someone has an idea how to find out what's wrong? I don't know what to do if I don't have any error messages to clarify the situation. Any help will be appreciated.

  • May 26, 2011
  • Like
  • 0