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

Discussion in 'Java' started by Walter Stucki, Dec 19, 2003.

  1. 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.setApplicationProperties(ConsoleInput.java:182)
    at ch.post.pf.eaipf.iqscanner.input.ConsoleInput.startApplication(ConsoleInput.java:98)
    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.setApplicationProperties(Unknown
    Source)
    at ch.post.pf.eaipf.iqscanner.input.ConsoleInput.startApplication(Unknown
    Source)
    at ch.post.pf.eaipf.iqscanner.input.ConsoleInput.main(Unknown
    Source)
    ============================================
     
    Walter Stucki, Dec 19, 2003
    #1
    1. Advertising

  2. 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?
     
    Thomas Kellerer, Dec 19, 2003
    #2
    1. Advertising

  3. Hi Thomas

    Thanks !

    Thomas Kellerer <> wrote in message news:<brur88$7jke0$-berlin.de>...
    > 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?
     
    Walter Stucki, Dec 20, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SG9wZQ==?=

    Stack Trace Line Number

    =?Utf-8?B?SG9wZQ==?=, Feb 25, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    650
    MasterGaurav
    Feb 25, 2005
  2. Shapper

    Why this code line doens't work?

    Shapper, Apr 29, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,611
    Shapper
    Apr 29, 2005
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,128
    Smokey Grindel
    Dec 2, 2006
  4. Chris Newby
    Replies:
    0
    Views:
    793
    Chris Newby
    Jul 28, 2008
  5. posting
    Replies:
    1
    Views:
    110
    Ray at
    Apr 22, 2004
Loading...

Share This Page