Thread: [Pydev-code] Debugging jython called from Java
Brought to you by:
fabioz
From: dperez <cra...@ya...> - 2006-09-26 07:26:21
|
Hi, I'm evaluating PyDev and like it. But I wonder if I can debug Jython code when the jython code is called from Java code (e.g. a web server). Thanks in advance for any hint. Cheers, David -- View this message in context: http://www.nabble.com/Debugging-jython-called-from-Java-tf2317042.html#a6444665 Sent from the pydev-code mailing list archive at Nabble.com. |
From: Fabio Z. <fa...@gm...> - 2006-09-26 10:45:52
|
> > > I'm evaluating PyDev and like it. > But I wonder if I can debug Jython code when the jython code is called > from > Java code (e.g. a web server). > > You should be able to do it with the remote debugger: http://fabioz.com/pydev/manual_adv_remote_debugger.html Cheers, Fabio |
From: dperez <cra...@ya...> - 2006-09-27 09:17:24
|
Hi, It works ok. :-) I'll try to convince my boss to purchase the extensions. But the console is working when not using the debug server. I enter a simple expression (like 1+1), hit twice Enter and nothing happens. It works ok when starting standalone .py programs. Fabio Zadrozny-2 wrote: > >> >> >> I'm evaluating PyDev and like it. >> But I wonder if I can debug Jython code when the jython code is called >> from >> Java code (e.g. a web server). >> >> > You should be able to do it with the remote debugger: > http://fabioz.com/pydev/manual_adv_remote_debugger.html > -- View this message in context: http://www.nabble.com/Debugging-jython-called-from-Java-tf2317042.html#a6523348 Sent from the pydev-code mailing list archive at Nabble.com. |
From: dperez <cra...@ya...> - 2006-09-27 09:34:38
|
Hi, Another small problem, I remove a breakpoint and continues to be hit. This happens even if I restart my app and the debug server. Does the call to pydevd.settrace() takes long? I haven't been able to measure how long it takes, because of the breakpoint I can't remove. Is it advisable to leave this call in production? Thanks for any hint. dperez wrote: > > Hi, > > It works ok. :-) > I'll try to convince my boss to purchase the extensions. > But the console is working when not using the debug server. I enter a > simple expression (like 1+1), hit twice Enter and nothing happens. > It works ok when starting standalone .py programs. > > > Fabio Zadrozny-2 wrote: >> >>> >>> >>> I'm evaluating PyDev and like it. >>> But I wonder if I can debug Jython code when the jython code is called >>> from >>> Java code (e.g. a web server). >>> >>> >> You should be able to do it with the remote debugger: >> http://fabioz.com/pydev/manual_adv_remote_debugger.html >> > > -- View this message in context: http://www.nabble.com/Debugging-jython-called-from-Java-tf2317042.html#a6523582 Sent from the pydev-code mailing list archive at Nabble.com. |
From: dperez <cra...@ya...> - 2006-09-27 12:51:39
|
Hi, Each time I create a new interpreter, I use this code: public PythonInterpreter getInterpreter() { PythonInterpreter py = new PythonInterpreter(); py.exec("import pydevd\n"+ "pydevd.settrace(stdoutToServer=1, stderrToServer=1)"); return py; } It works ok. The problem is that the PyDev server debugger stops always in the call to pydevd.settrace(). Can this be avoided? I only want PyDev to stop when I set a breakpoint. dperez wrote: > > Another small problem, I remove a breakpoint and continues to be hit. > This happens even if I restart my app and the debug server. > > Does the call to pydevd.settrace() takes long? > I haven't been able to measure how long it takes, because of the > breakpoint I can't remove. > Is it advisable to leave this call in production? > -- View this message in context: http://www.nabble.com/Debugging-jython-called-from-Java-tf2317042.html#a6526055 Sent from the pydev-code mailing list archive at Nabble.com. |
From: Fabio Z. <fa...@gm...> - 2006-09-27 10:48:18
|
On 9/27/06, dperez <cra...@ya...> wrote: > > > But the console is working when not using the debug server. I enter a > simple expression (like 1+1), hit twice Enter and nothing happens. > It works ok when starting standalone .py programs. > > Have you set: pydevd.settrace(stdoutToServer=True, stderrToServer=True)... because it should put the message to the console, but if your running program console is not within the pydev, it will not print to the console unless you ask it to redirect the output to the pydev output... Cheers, Fabio |
From: dperez <cra...@ya...> - 2006-09-27 12:46:44
|
Hi, Thanks Fabio for your explanation. Now, I have set as you have told me, and it doesn't still work. The cause of this is surely that I need to redirect the org.python.util.PythonInterpreter output to the servlet response stream, because all the print's in Python code, are sent to the browser. Fabio Zadrozny-2 wrote: > > On 9/27/06, dperez <cra...@ya...> wrote: >> >> >> But the console is working when not using the debug server. I enter a >> simple expression (like 1+1), hit twice Enter and nothing happens. >> It works ok when starting standalone .py programs. >> >> > Have you set: pydevd.settrace(stdoutToServer=True, stderrToServer=True)... > because it should put the message to the console, but if your running > program console is not within the pydev, it will not print to the console > unless you ask it to redirect the output to the pydev output... > > Cheers, > > Fabio > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > > -- View this message in context: http://www.nabble.com/Debugging-jython-called-from-Java-tf2317042.html#a6525954 Sent from the pydev-code mailing list archive at Nabble.com. |