Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > stack trace: why doens't it show the line number ?

Reply
Thread Tools

stack trace: why doens't it show the line number ?

 
 
Walter Stucki
Guest
Posts: n/a
 
      12-19-2003
Hi

Case a) JVM shows in the stack trace the line number if I'm running my
java application with class-files (e.g. ConsoleInput.java:182):

Case b) The JVM doesn't show the line number information if I'm
running the same application as a jar-file (It shows unknown source)

My questions:
- Is the reason for this behavior (doesn't show line number) because
the application is running as a jar?
- Is there a workaround to show the line number in the stack trace if
Im working with a jar?



--------------------------Case a)--------------------------------
$ java -classpath "C:\iqscanner\classes;" -showversion
ch.post.pf.eaipf.iqscanner.input.ConsoleInput -v:minor
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

19.12.2003, 12:46:34.345=[9]== {iq-scanner about ConsoleInput STARTED}
==
19.12.2003, 12:46:34.345=[5]== {verbose mode set} ==
error occured:
mode isn't set (required)
try "iqscanner -h" for more informations
java.lang.IllegalArgumentException: mode isn't set (required)
at ch.post.pf.eaipf.iqscanner.input.ConsoleInput.setA pplicationProperties(ConsoleInput.java:182)
at ch.post.pf.eaipf.iqscanner.input.ConsoleInput.star tApplication(ConsoleInput.java:9
at ch.post.pf.eaipf.iqscanner.input.ConsoleInput.main (ConsoleInput.java:66)
============================================

--------------------------Case b)--------------------------------
$ java -classpath iqscanner.jar
ch.post.pf.eaipf.iqscanner.input.ConsoleInput
19.12.2003, 12:46:15.989=[9]== {iq-scanner about ConsoleInput STARTED}
==
19.12.2003, 12:46:15.989=[5]== {verbose mode set} ==
error occured:
mode isn't set (required)
try "iqscanner -h" for more informations
java.lang.IllegalArgumentException: mode isn't set (required)
at ch.post.pf.eaipf.iqscanner.input.ConsoleInput.setA pplicationProperties(Unknown
Source)
at ch.post.pf.eaipf.iqscanner.input.ConsoleInput.star tApplication(Unknown
Source)
at ch.post.pf.eaipf.iqscanner.input.ConsoleInput.main (Unknown
Source)
============================================
 
Reply With Quote
 
 
 
 
Thomas Kellerer
Guest
Posts: n/a
 
      12-19-2003
You need to compile your sources with the -g flag, in order to ge line numbers
in the class file

Thomas


Walter Stucki schrieb:

> Hi
>
> Case a) JVM shows in the stack trace the line number if I'm running my
> java application with class-files (e.g. ConsoleInput.java:182):
>
> Case b) The JVM doesn't show the line number information if I'm
> running the same application as a jar-file (It shows unknown source)
>
> My questions:
> - Is the reason for this behavior (doesn't show line number) because
> the application is running as a jar?
> - Is there a workaround to show the line number in the stack trace if
> Im working with a jar?


 
Reply With Quote
 
 
 
 
Walter Stucki
Guest
Posts: n/a
 
      12-20-2003
Hi Thomas

Thanks !

Thomas Kellerer <> wrote in message news:<brur88$7jke0$>...
> You need to compile your sources with the -g flag, in order to ge line numbers
> in the class file
>
> Thomas
>
>
> Walter Stucki schrieb:
>
> > Hi
> >
> > Case a) JVM shows in the stack trace the line number if I'm running my
> > java application with class-files (e.g. ConsoleInput.java:182):
> >
> > Case b) The JVM doesn't show the line number information if I'm
> > running the same application as a jar-file (It shows unknown source)
> >
> > My questions:
> > - Is the reason for this behavior (doesn't show line number) because
> > the application is running as a jar?
> > - Is there a workaround to show the line number in the stack trace if
> > Im working with a jar?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does std::stack::pop() not throw an exception if the stack is empty? Debajit Adhikary C++ 36 02-10-2011 08:54 PM
C/C++ compilers have one stack for local variables and return addresses and then another stack for array allocations on the stack. Casey Hawthorne C Programming 3 11-01-2009 08:23 PM
Why stack overflow with such a small stack? Kenneth McDonald Ruby 7 09-01-2007 04:21 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Read a file line by line with a maximum number of characters per line Hugo Java 10 10-18-2004 11:42 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57