Issue1528
Created on 2009-12-21.13:34:59 by markku_hanninen, last changed 2013-02-26.19:00:58 by fwierzbicki.
Messages | |||
---|---|---|---|
msg5389 (view) | Author: Markku Hänninen (markku_hanninen) | Date: 2009-12-21.13:34:57 | |
This is how to reproduce the problem: GenJavaErr.java: public class GenJavaErr { static public void genErr() throws Exception { Exception ex = new Exception("Exception from java"); ex.printStackTrace(); throw ex; } } errtest.py: #!/usr/bin/env jython import GenJavaErr def err(): GenJavaErr.genErr() return "Dummy return" err() [hmm@bombadil jythontest]$ javac GenJavaErr.java [hmm@bombadil jythontest]$ jython errtest.py *sys-package-mgr*: can't create package cache dir, '/opt/jython2.5.1/cachedir/packages' java.lang.Exception: Exception from java at GenJavaErr.genErr(GenJavaErr.java:3) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:175) at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190) at org.python.core.PyObject.__call__(PyObject.java:381) at org.python.core.PyObject.__call__(PyObject.java:385) at org.python.pycode._pyx0.err$1(errtest.py:8) at org.python.pycode._pyx0.call_function(errtest.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyBaseCode.call(PyBaseCode.java:117) at org.python.core.PyFunction.__call__(PyFunction.java:307) at org.python.pycode._pyx0.f$0(errtest.py:11) at org.python.pycode._pyx0.call_function(errtest.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.Py.runCode(Py.java:1204) at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:200) at org.python.util.jython.run(jython.java:246) at org.python.util.jython.main(jython.java:129) Traceback (most recent call last): File "errtest.py", line 11, in <module> err() File "errtest.py", line 6, in err GenJavaErr.genErr() at GenJavaErr.genErr(GenJavaErr.java:3) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) java.lang.Exception: java.lang.Exception: Exception from java Notice here how the Java-exception has line: at org.python.pycode._pyx0.err$1(errtest.py:8) But the actual call is: File "errtest.py", line 6, in err Actually in java the reported line is always the last line of the method/function. This is a problem in our system which has long call chains and the error handler doesn't have the python exception available so we don't really know on what line the call was. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2013-02-26 19:00:58 | fwierzbicki | set | priority: normal |
2013-02-26 19:00:47 | fwierzbicki | set | nosy: + fwierzbicki |
2013-02-20 18:58:57 | fwierzbicki | set | versions: + Jython 2.5, - 2.5.1 |
2010-08-15 14:49:10 | zyasoft | set | nosy: + zyasoft |
2009-12-21 13:34:59 | markku_hanninen | create |
Supported by Python Software Foundation,
Powered by Roundup