I have released my robot onto my github account.
You can have a look at the main code here:
https://github.com/Sycadellicman/Anonymous-Robot/blob/master/src/com/anonymous/engine/AnonymousEngineServlet.java
Also, I have attached the exception I am getting after adding the robot to a
wave.
As you can see, it occurs after the robot calls submit. The returned list is
indeed
empty, i.e. isEmpty() returns true. I have tried re-registering the robot on
my server
and on other servers and have made sure that I update the secrets, keys, and
domains.
I am at a lose as to what is causing this. Like I said, it was working
several days ago but
when added the robot to a wave this evening, I noticed it was misbehaving.
I really appreciate your help, Yuri. If anyone has any ideas or suggestions
given this new
information I would be more than happy to listen to them!
Patrick Jennings
On Thu, Apr 21, 2011 at 9:34 PM, Patrick Jennings
<[email protected]>wrote:
> My robot does the following in the constructor:
> setupOAuth(CONSUMER_KEY, CONSUMER_SECRET, rpcserverurl);
> setAllowUnsignedRequests(true);
>
> Everything was working when I tested the server and robot 3 days ago. I
> hadn't even restarted the server or the robot since then. Why would I be
> getting:
> net.oauth.OAuthProblemException: timestamp_refused
>
> Patrick Jennings
>
> On Fri, Apr 22, 2011 at 12:39 AM, Yuri Z <[email protected]> wrote:
>
>> Please make sure your robot calls setupOAuth() method and that the
>> key/secret are correct. Try to re-register the robot on the server.
>>
>> 2011-04-21 20:21:13.793:DBUG::servlet holder=
>> org.waveprotocol.box.server.robots.active.ActiveApiServlet-278604369
>> 2011-04-21 20:21:13.793:DBUG::chain= null
>> Apr 21, 2011 8:21:13 PM
>> org.waveprotocol.box.server.robots.dataapi.BaseApiServlet
>> processOpsRequest
>> INFO: The message does not conform to OAuth
>> net.oauth.OAuthProblemException: timestamp_refused
>> at
>> net.oauth.SimpleOAuthValidator.validateTimestamp(SimpleOAuthValidator.java:218)
>> at
>> net.oauth.SimpleOAuthValidator.validateTimestampAndNonce(SimpleOAuthValidator.java:208)
>> at
>> net.oauth.SimpleOAuthValidator.validateMessage(SimpleOAuthValidator.java:147)
>> at
>> org.waveprotocol.box.server.robots.dataapi.BaseApiServlet.processOpsRequest(BaseApiServlet.java:105)
>> at org.waveprotocol.box.server.robots.activ
>>
>>
>> 2011/4/22 Patrick Jennings <[email protected]>
>>
>> > I have attached a server log. What is happening is:
>> > 1. I add the registered robot to a wave
>> > 2. The robot correctly receives the event and starts processing the
>> > onWaveletSelfAdded method.
>> > 3. The robot gets to the submit call to create a new wave
>> > 4. Robot receives empty list from submit and throws a
>> NullPointerException
>> > at:
>> > Map<ParamsProperty, Object> data = jsonRpcResponse.getData();
>> >
>> >
>> > On Fri, Apr 22, 2011 at 12:13 AM, Yuri Z <[email protected]> wrote:
>> > >
>> > > Did you try to check the server logs? Can you attach the outgoing
>> jsons
>> > and
>> > > incoming?
>> > >
>> > > 2011/4/22 Patrick Jennings <[email protected]>
>> > >
>> > > > I am using the following method in my robot to process the list
>> > > > of JsonRpcResponse objects
>> > > > returned from a call to com.google.wave.api.AbstractRobot.submit:
>> > > >
>> > > > private String getParam(List<JsonRpcResponse> response,
>> ParamsProperty
>> > p) {
>> > > > for(JsonRpcResponse jsonRpcResponse : response) {
>> > > > Map<ParamsProperty, Object> data = jsonRpcResponse.getData();
>> > > > String param = (String) data.get(p);
>> > > > if(param != null)
>> > > > return param;
>> > > > }
>> > > > return null;
>> > > > }
>> > > > (from:
>> > > >
>> >
>> http://www.mail-archive.com/[email protected]/msg04969.html
>> > > > )
>> > > >
>> > > > This is very useful since I can do something like:
>> > > > String newwaveid = getParam(submit(newwave,
>> > > > rpcserverurl), ParamsProperty.WAVE_ID);
>> > > > to get back the id of the newly created wave from the WIAB server.
>> > > >
>> > > > This was working fine until a few days ago when I started getting
>> > > > a NullPointerException
>> > > > from the line:
>> > > > Map<ParamsProperty, Object> data = jsonRpcResponse.getData();
>> > > >
>> > > > It seems that the submit call is now returning an empty
>> > > > list of JsonRpcResponse objects.
>> > > > Has anything changing in the last couple of days that could have
>> caused
>> > > > this?
>> > > >
>> > > > Any help would be greatly appreciated. I have to give a demo of my
>> > robot
>> > > > tomorrow
>> > > > so I am in desperate need of some assistance.
>> > > >
>> > > > Thank you,
>> > > > Patrick Jennings
>> > > >
>> >
>> >
>>
>
>
/_wave/robot/jsonrpc
java.lang.NullPointerException
at
com.anonymous.engine.AnonymousEngineServlet.getParam(AnonymousEngineServlet.java:169)
at
com.anonymous.engine.AnonymousEngineServlet.onWaveletSelfAdded(AnonymousEngineServlet.java:90)
at
com.google.wave.api.AbstractRobot.processEvents(AbstractRobot.java:640)
at com.google.wave.api.AbstractRobot.processRpc(AbstractRobot.java:589)
at com.google.wave.api.AbstractRobot.doPost(AbstractRobot.java:317)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
at
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261)
at
com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9285)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:437)
at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
at
com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
at
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
at
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
at
com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)