Hi Pamela

I am trying to create a small robot with the Active API and have being
following the tutorial from the documentation, as well as reading the
code from Buggy. The only thing I want the robot to do, is to create a
new Wave with every participant of a wave where it is added. I have
managed to verify the robot using the following code in the
constructor (with the values assigned to the robot):

String verificationToken = "...";
String securityToken = "...";
setupVerificationToken(verificationToken, securityToken);

However when I try to authenticate the robot with this (with the
values I get form the site):

setupOAuth("..", "..", "http://sandbox.gmodules.com/api/rpc";);

I get the following error and the robot does not work.

Uncaught exception from servlet
java.lang.IllegalArgumentException: No consumer key is found for the
RPC server URL:
        at
com.google.wave.api.AbstractRobot.deserializeEvents(AbstractRobot.java:
1018)
        at com.google.wave.api.AbstractRobot.processRpc(AbstractRobot.java:
859)
        at com.google.wave.api.AbstractRobot.doPost(AbstractRobot.java:584)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1093)
        at
com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:
97)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
        at
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:
35)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
        at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
360)
        at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
181)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
        at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
238)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
139)
        at org.mortbay.jetty.Server.handle(Server.java:313)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
506)
        at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:830)
        at
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:
76)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
        at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
135)
        at
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
235)
        at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:5485)
        at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:5483)
        at
com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:
24)
        at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
363)
        at com.google.net.rpc.impl.Server$2.run(Server.java:837)
        at
com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:
56)
        at
com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:
536)
        at com.google.net.rpc.impl.Server.startRpc(Server.java:792)
        at com.google.net.rpc.impl.Server.processRequest(Server.java:367)
        at
com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:
448)
        at
com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:
319)
        at
com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:
290)
        at com.google.net.async.Connection.handleReadEvent(Connection.java:
474)
        at
com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:
774)
        at
com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:
205)
        at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:
101)
        at
com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:
251)
        at com.google.apphosting.runtime.JavaRuntime
$RpcRunnable.run(JavaRuntime.java:394)
        at java.lang.Thread.run(Unknown Source)

Could you please give me some advice as to what I may be doing wrong?

Thanks, regards
Conrado

On Mar 10, 6:22 am, "pamela (Google Employee)" <[email protected]>
wrote:
> You can simplify that by storing it in a separate file or the code itself.
>
> I am modifying the docs to say the following:
>
> To authenticate in Java, call setupOauth in the constructor for your robot.
> See the sample code below:
>
> public MyRobot() {
>   myRobot.setupOAuth(CONSUMER_KEY, CONSUMER_SECRET,
> "http://sandbox.gmodules.com/api/rpc";);
>
> }
>
> Those two parameters can just be local String contants.
>
> - pamela
>
>
>
> On Mon, Mar 8, 2010 at 9:53 AM, Toub <[email protected]> wrote:
> > Hi,
>
> > Thanks for this information.
>
> > I still not understand how the example robot retrieve the system
> > property, if it is hosted by App Engine:
>
> > OAUTH_TOKEN = System.getProperty("OAUTH_TOKEN")
>
> > How can I set this property ?
>
> > Thanks
>
> > On 6 mar, 03:05, "pamela (Google Employee)" <[email protected]>
> > wrote:
> > > Thanks for the feedback, Eric, we'll clarify that section to show where
> > to
> > > put the code. It's non-obvious in Java.
>
> > > For reference, the Buggy sample uses Java SDK and the active API. The
> > > relevant code is in the constructor:
> >http://google-wave-resources.googlecode.com/svn/trunk/samples/extensi...
>
> > > <http://google-wave-resources.googlecode.com/svn/trunk/samples/extensi..
> > .>I'll
> > > clarify the docs to show it inside a constructor.
>
> > > - pamela
>
> > > On Thu, Mar 4, 2010 at 8:30 AM, Eric Kolotyluk <[email protected]
> > >wrote:
>
> > > >  I'm trying to follow the Authenticating Your Robots<
> >http://code.google.com/apis/wave/extensions/robots/operations.html#Ac...>instructions
> > but nothing tells me how to create the handler the registration
> > > > page calls for.
>
> > > > Please create a new handler at
> > > >http://pressybot.appspot.com/_wave/verify_token?st=####thatresponds
> > with
> > > > that token. The server will contact your robot at that URL to verify
> > the
> > > > token. You can use the *st* query parameter to ensure that the request
> > is
> > > > coming from our server.
>
> > > > Once you have created the handler, please click the *Verify* button
> > below.
> > > >  It would be nicer if the tutorial was complete instead of assuming you
> > > > already know how to do this. For example, if you created a robot using
> > the Robot
> > > > Tutorial<
> >http://code.google.com/apis/wave/extensions/robots/java-tutorial.html>how
> > would you modify the robot to add the handler?
>
> > > > Cheers, Eric
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Google Wave API" group.
> > > > To post to this group, send email to [email protected].
> > > > To unsubscribe from this group, send email to
> > > > [email protected]<google-wave-api%2Bunsubscribe@
> > > >  googlegroups.com>
> > <google-wave-api%[email protected]<google-wave-api%252Bunsubsc 
> > [email protected]>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-wave-api?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Wave API" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-wave-api%2Bunsubscribe@ 
> > googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-wave-api?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.

Reply via email to