Ah, I managed to run the samples. I was always having the error 417
while connected under the institute's firewall, but after disabling
this network connection and using the 3G from my phone, it worked
flawlessly!

I'll try now German's solution to see if it works, thanks!

On Aug 17, 5:22 pm, Robson Dantas <biu.dan...@gmail.com> wrote:
> Good!
>
> Would be also great if you could write down it on project's wiki, or forward
> to Prashant or Shishir.
>
> -Robson
>
> 2010/8/17 German Wachnitz <gwachn...@gmail.com>
>
>
>
>
>
>
>
> > OK I finaly managed to make this work. In my case this had todo with
> > how our company manages its network.
>
> > There are to HttpClients you can use with OAuth:
>
> >  URLConnectionClient and HttpClient4(used in the sample application).
>
> > HttpCllient4 uses connection pooling wich when you work behind a
> > strict firewall wont work very well, so what I did was I changed this
> > client:
>
> > In the Class Transport.java, in the init() method, change this line:
>
> > client.setOAuthClient(new OAuthClient(new HttpClient4()));
>
> > for this one:
>
> > client.setOAuthClient(new OAuthClient(new URLConnectionClient()));
>
> > Hoped this helped
> > German
>
> > On Aug 17, 4:10 pm, Paulo Cesar <pueloce...@gmail.com> wrote:
> > > Hi Robson, how do you managed to bypass this 417 error? I'm just stuck
> > > on this..
>
> > > On Aug 6, 4:38 pm, Robson Dantas <biu.dan...@gmail.com> wrote:
>
> > > > Hi,
>
> > > > Got this error too, and in my case was oauth authencation problem. When
> > > > developing the php library, got issues like that too (and am still
> > getting).
>
> > > > I reported it to Prashant, and a bug was filled.
>
> > > > Regards,
>
> > > > Robson
>
> > > > 2010/8/5 German Wachnitz <gwachn...@gmail.com>
>
> > > > > Hi, i have been tring to get the sample going without luck. At first
> > > > > it throw me a http 411 error. To resolved it I added the line:
> > > > >  request.addHeader("Content-Length","" + body.length);
> > > > > to the sendRequest method of the transpor Object.
> > > > > After that i got an 417 error. I modified the code in order to show
> > > > > more error info and this is what I got:
>
> > > > >  test-auth:
> > > > >     [java] Request: [{"params":
>
> > {"captchaAnswer":"answer","captchaToken":"token","groupId":"@self","userId":"@me"},"id":"0-
> > > > > cpta.a","metho
> > > > > d":"captcha.answer"}]
> > > > >     [java] BaseUrl:http://www.orkut.com/social/rpc
> > > > >     [java] Header:
> > > > >     [java] Name: Content-Type Value: application/json
> > > > >     [java] Name: X-Orkut-Client-Lib Value: 1.1
> > > > >     [java] Name: Content-Length Value: 137
> > > > >     [java] Exception during access:HTTP/1.0 417 Expectation failed
> > > > >     [java] net.oauth.OAuthProblemException: HTTP/1.0 417 Expectation
> > > > > failed
> > > > >     [java]     at
>
> > net.oauth.client.OAuthResponseMessage.toOAuthProblemException(OAuthResponseMessage.java:
> > > > > 83)
> > > > >     [java]     at
> > > > > net.oauth.client.OAuthClient.invoke(OAuthClient.java:306)
> > > > >     [java]     at
>
> > net.oauth.example.desktop.DesktopClient.invoke(DesktopClient.java:219)
> > > > >     [java]     at
>
> > net.oauth.example.desktop.DesktopClient.access(DesktopClient.java:128)
> > > > >     [java]     at
> > > > > com.google.orkut.client.sample.Transport.sendRequest(Transport.java:
> > > > > 126)
> > > > >     [java]     at
> > > > > com.google.orkut.client.sample.Transport.run(Transport.java:103)
> > > > >     [java]     at
> > > > > com.google.orkut.client.sample.TestOrkutAuth.run(TestOrkutAuth.java:
> > > > > 39)
> > > > >     [java]     at
> > > > > com.google.orkut.client.sample.TestOrkutAuth.main(TestOrkutAuth.java:
> > > > > 53)
> > > > >     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > > > Method)
> > > > >     [java]     at
>
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> > > > > 39)
> > > > >     [java]     at
>
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> > > > > 25)
> > > > >     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:
> > > > > 152)
> > > > >     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:
> > > > > 771)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
> > > > >     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > > > Method)
> > > > >     [java]     at
>
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> > > > > 39)
> > > > >     [java]     at
>
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> > > > > 25)
> > > > >     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >     [java]     at
>
> > org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
> > > > > 106)
> > > > >     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
> > > > >     [java]     at org.apache.tools.ant.Target.execute(Target.java:
> > > > > 390)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.Target.performTasks(Target.java:411)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.Project.executeTarget(Project.java:1366)
> > > > >     [java]     at
>
> > org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:
> > > > > 41)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.Project.executeTargets(Project.java:1249)
> > > > >     [java]     at org.apache.tools.ant.Main.runBuild(Main.java:801)
> > > > >     [java]     at org.apache.tools.ant.Main.startAnt(Main.java:218)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
> > > > >     [java] RETURNING
> > > > >     [java] Authentication FAILED
> > > > >     [java] java.lang.RuntimeException: Unexpected exception while
> > > > > setting response
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:
> > > > > 194)
> > > > >     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:
> > > > > 771)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
> > > > >     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > > > Method)
> > > > >     [java]     at
>
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> > > > > 39)
> > > > >     [java]     at
>
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> > > > > 25)
> > > > >     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >     [java]     at
>
> > org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
> > > > > 106)
> > > > >     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
> > > > >     [java]     at org.apache.tools.ant.Target.execute(Target.java:
> > > > > 390)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.Target.performTasks(Target.java:411)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.Project.executeTarget(Project.java:1366)
> > > > >     [java]     at
>
> > org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:
> > > > > 41)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.Project.executeTargets(Project.java:1249)
> > > > >     [java]     at org.apache.tools.ant.Main.runBuild(Main.java:801)
> > > > >     [java]     at org.apache.tools.ant.Main.startAnt(Main.java:218)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
> > > > >     [java] Caused by: java.lang.RuntimeException: Unexpected
> > > > > exception while setting response
> > > > >     [java]     at
> > > > > com.google.orkut.client.api.BatchTransaction.setResponse(Unknown
> > > > > Source)
> > > > >     [java]     at
> > > > > com.google.orkut.client.sample.Transport.run(Transport.java:104)
> > > > >     [java]     at
> > > > > com.google.orkut.client.sample.TestOrkutAuth.run(TestOrkutAuth.java:
> > > > > 39)
> > > > >     [java]     at
> > > > > com.google.orkut.client.sample.TestOrkutAuth.main(TestOrkutAuth.java:
> > > > > 53)
> > > > >     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > > > Method)
> > > > >     [java]     at
>
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> > > > > 39)
> > > > >     [java]     at
>
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> > > > > 25)
> > > > >     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
> > > > >     [java]     at
> > > > > org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:
> > > > > 152)
> > > > >     [java]     ... 21 more
> > > > >     [java] Caused by: org.json.me.JSONException: A JSONArray text
> > > > > must start with '[' at character 0 of
> > > > >     [java]     at
> > > > > org.json.me.JSONTokener.syntaxError(JSONTokener.java:448)
> > > > >     [java]     at org.json.me.JSONArray.<init>(JSONArray.java:106)
> > > > >     [java]     at org.json.me.JSONArray.<init>(JSONArray.java:145)
> > > > >     [java]     ... 31 more
> > > > >     [java] Java Result: -1
>
> ...
>
> read more »

-- 
You received this message because you are subscribed to the Google Groups 
"orkut Developer Forum" group.
To post to this group, send email to opensocial-or...@googlegroups.com.
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en.

Reply via email to