Is there any way to debug the code in service writing with ProtoRPC?(SDK 1.7.6)

20 views
Skip to first unread message

刘鹏

unread,
Mar 26, 2013, 11:46:43 AM3/26/13
to google-prot...@googlegroups.com
Hi,There.
    I use ProtoRPC since the Google App Engine SDK 1.7.3.
    I update the Google App Engine SDK from 1.7.5 to 1.7.6. And then I found the register service code have changed, so I follow your up to date code in the ProtoRPC Overview. And then I can use the ProtoRPC successfully. But I found a very annoy problem is that I can't let step into the break point I used to do.
   I noticed that the code changed and leads out there is no place to set debug=True.
   The old code is like this:
              from google.appengine.ext import webapp
              application = webapp.WSGIApplication( service_handlers.service_mapping(     [('/postservice', postservice.PostService)]), debug=True)
  And the new code is like this:
              from protorpc.wsgi import service
              app = service.service_mappings([('/postservice', postservice.PostService)])
  I have roughly go through the source code of protorpc.wsgi.service class, and find no key word "debug".
  So I couldn't find out how to enable the debug in ProtoRPC with the GAE SDK 1.7.6.
  Can anyone supply some solutions?

Danny Hermes

unread,
Mar 26, 2013, 12:00:51 PM3/26/13
to google-prot...@googlegroups.com
What's wrong with how you were doing it before?


--
You received this message because you are subscribed to the Google Groups "ProtoRPC Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-protorpc-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Danny Hermes
Developer Programs Engineer

刘鹏

unread,
Mar 26, 2013, 12:10:23 PM3/26/13
to google-prot...@googlegroups.com
    I operate as usual as the normal operation before. I use Eclipse+Pydev. And before I upgrade the SDK from 1.7.5 to 1.7.6 I set some break in the service method just like this
class PostService(remote.Service):
     @remote.method(FPMessage, message_types.VoidMessage)
    def post_fpmessage(self, request):
        # extract and decode source info
        startTime = datetime.strptime(request.startTime, "%Y-%m-%d  %H:%M:%S")
        .......
    I set the break point on the green line. And when I use client code to call the http://localhost:8080/postservice.post_fpmessage to send some JSON data. It should have to get the code running stop at the green line and then I can use step over , step into or something while the SDK is 1.7.5 and I haven't change the web service register code.
   But today, after I fixed the web service register code. And then I can't step into the break point.
   I was wondering this is the problem with my configuration or the current code state just can't use debug mode.
在 2013年3月26日星期二UTC+8下午11时46分43秒,刘鹏写道:

Danny Hermes

unread,
Mar 26, 2013, 12:12:21 PM3/26/13
to google-prot...@googlegroups.com
This is a problem with dev_appserver2, not with protorpc.

See


--
You received this message because you are subscribed to the Google Groups "ProtoRPC Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-protorpc-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

刘鹏

unread,
Mar 26, 2013, 12:18:00 PM3/26/13
to google-prot...@googlegroups.com
Thank you for your reply. It's late here now. I'm so sleepy. Hope I can solve this problem soon.
Thank you again. I really appreciate it. The info with ProtoRPC is so hard to find except here.

在 2013年3月27日星期三UTC+8上午12时12分21秒,Danny Hermes写道:

Danny Hermes

unread,
Mar 26, 2013, 12:22:30 PM3/26/13
to google-prot...@googlegroups.com
If it wasn't clear before, your issue was not specific to ProtoRPC, but instead to App Engine as a whole.


--
You received this message because you are subscribed to the Google Groups "ProtoRPC Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-protorpc-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rafe Kaplan

unread,
Mar 26, 2013, 3:30:39 PM3/26/13
to google-prot...@googlegroups.com
  It looks like you are migrating from using the webapp (deprecated) ProtoRPC request handler to the WSGI request handler.  If that's the case, then no, there is not a debug flag in the API.  However, that should not prevent you from setting breakpoints from within your debugger.

  When you make requests to your dev-appserver are you receiving any kind of error response?  Also errors should automatically appear in your log.  Are you able to see those?


On Tue, Mar 26, 2013 at 9:10 AM, 刘鹏 <myme5...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "ProtoRPC Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-protorpc-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
 - Rafe Kaplan

刘鹏

unread,
Mar 26, 2013, 9:25:20 PM3/26/13
to google-prot...@googlegroups.com
    Hi There,
        I found it has nothing to do with the debug flag.
An optional debug=True argument puts the application in debugging mode, which tells webapp to display a stack trace in the browser when a handler raises an exception. By default, webapp just returns an HTTP 500 error when an error occurs.
       And I found it as a problem with the dev_appserver.py in version GAE SDK 1.7.6
       It's the same with my issue. So I think it's the problem with dev-appserver.py but I still can't find out a solution to enable the breakpoint triggered again.

在 2013年3月27日星期三UTC+8上午3时30分39秒,Rafe Kaplan写道:
 - Rafe Kaplan
Reply all
Reply to author
Forward
0 new messages