Search code examples
blackberryhttpconnection

BlackBerry Connection issue : Cannot open any more tunnels


I get this error when i try to authenticate via OAuth, i am able to use the connection factory to access unauthenticated requests. It works fine on the simulator but doesnt work on the device. It worked once or twice on the device but fails consistently every other time.

I have tried manually setting the APN on the phone but still unable to connect, while other requests successfully execute.


Solution

  • I am using the Connection Framework from BB OS5 and higher, so the connection was not the problem. The GET and POST requests worked well over the simulator but the POST request failed on the phone, while the GET request worked on the phone. The problem was a simple error in the POST request, i set the content length to just account for the URL instead of also the data being sent. I simply removed the content length in the POST URL and all was ok.