Message1493

Author nhiro
Recipients
Date 2007-02-18.17:44:53
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
When I compiled a script to JAR,
all line numbers on stacktrace are zero.

================
C:\jython2.2b1>java -jar test.jar
Exception in thread "main" Traceback (innermost last):
  File "C:\jython2.2b1\test.py", line 0, in main
  File "C:\jython2.2b1\test.py", line 0, in foo
  File "C:\jython2.2b1\test.py", line 0, in bar
ZeroDivisionError: integer division or modulo by zero
================

I write how to reproduce the problem below.

1: Make a script 'test.py'

================
def foo():
  bar()

def bar():
  1/0

foo()
================

2: Run it on jython. it works well.

================
C:\jython2.2b1>jython test.py
Traceback (innermost last):
  File "test.py", line 7, in ?
  File "test.py", line 2, in foo
  File "test.py", line 5, in bar
ZeroDivisionError: integer division or modulo by zero
================

3: Compile it by jythonc...

================
C:\jython2.2b1>jythonc --jar test.jar --core test.py
processing test

Required packages:

Creating adapters:

Creating .java files:
  test module

Compiling .java to .class...
Compiling with args: ['C:\\Program Files\\Java\\jdk1.5.0_10\\bin\\javac', '-clas
spath', 'C:\\jython2.2b1\\jython.jar;C:\\Program Files\\Java\\jre1.5.0_05\\lib\\
ext\\QTJava.zip;.\\jpywork;;C:\\jython2.2b1\\Tools\\jythonc;C:\\jython2.2b1;C:\\
jython2.2b1\\Lib;__classpath__', '.\\jpywork\\test.java']
0
Building archive: test.jar
Tracking java dependencies:
================

4: And run it. It doesn't work well

================
C:\jython2.2b1>java -jar test.jar
Exception in thread "main" Traceback (innermost last):
  File "C:\jython2.2b1\test.py", line 0, in main
  File "C:\jython2.2b1\test.py", line 0, in foo
  File "C:\jython2.2b1\test.py", line 0, in bar
ZeroDivisionError: integer division or modulo by zero
================
History
Date User Action Args
2008-02-20 17:17:45adminlinkissue1662936 messages
2008-02-20 17:17:45admincreate