Re: solved - next step?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Re: solved - next step?

  1. #1
    Mark Sorteberg Guest

    Re: solved - next step?


    Thanks Tom:

    I just didn't know how to read the error code. What clued you in to line
    217 as the problem area. I assumed it was 377 or maybe 458. I made the
    false assumption, based on past debugging experience - solve the top item
    in the list first. I guess this gets down to a more basic question as to
    how to read Java error code. I assume we have some sort of a stack trace
    here.

    What does the bottom error message mean? Now that I fixed this problem when
    I run the code I get four errors all with "Compiled Code" at the end of each
    line. Thanks again for your help.

    Any good pointers or resources on how to read error code?

    Being the only developer has its drawbacks,

    Mark

    "Tom Duffy" <td4729@hotmail.com> wrote:
    >
    >Hello Mark:
    >
    >It looks like you are passing a null String into parseInt(). You're getting
    >a NumberFormatException as a result. The error looks to be at line 217

    of
    >GenerateReports.java. I'd check there and make sure I'm not passing in

    something
    >that won't parse to an int.
    >
    >HTH,
    >
    >Tom Duffy
    >
    >"Mark Sorteberg" <msorteberg@inspec.com> wrote:
    >>
    >>My Java code compiles fine, but when I go to run it I get this message:
    >>
    >>Exception in thread "main" java.lang.NumberFormat Exception: null
    >> at java.lang.Integer.parseInt(Integer.java:377)
    >> at java.lang.Integer.parseInt(Integer.java:458)
    >> at GenerateReports.<init>(GenerateReports.java:217)
    >> at GenerateReports.main(GenerateReports.java, Compiled Code)
    >>
    >>Any help would be appreciated.

    >



  2. #2
    Jo Desmet Guest

    Re: solved - next step?

    You are indeed looking at a stack trace. The top line is where the actual
    fatal action appeared: passing a null as a parameter is by itself not
    illegal, but calling a method from a null object is fatal. So it comes to
    going deeper into the stacktrace until you stumble uppon code that is
    actually writen by yourself.
    Sometimes in stead of the line number, you will see "Compiled Code" that is
    because the JVM has invoked its JIT compiler on this part of your coding and
    thus has lost any tracing information. It could be usefull in the debugging
    process to turn of your JIT compiler by adding the following option to your
    java command: "-Djava.compiler=NONE".

    greetings, Jo.

    "Mark Sorteberg" <msorteberg@inspec.com> wrote in message
    news:39908462$1@news.devx.com...
    >
    > Thanks Tom:
    >
    > I just didn't know how to read the error code. What clued you in to line
    > 217 as the problem area. I assumed it was 377 or maybe 458. I made the
    > false assumption, based on past debugging experience - solve the top item
    > in the list first. I guess this gets down to a more basic question as to
    > how to read Java error code. I assume we have some sort of a stack trace
    > here.
    >
    > What does the bottom error message mean? Now that I fixed this problem

    when
    > I run the code I get four errors all with "Compiled Code" at the end of

    each
    > line. Thanks again for your help.
    >
    > Any good pointers or resources on how to read error code?
    >
    > Being the only developer has its drawbacks,
    >
    > Mark
    >
    > "Tom Duffy" <td4729@hotmail.com> wrote:
    > >
    > >Hello Mark:
    > >
    > >It looks like you are passing a null String into parseInt(). You're

    getting
    > >a NumberFormatException as a result. The error looks to be at line 217

    > of
    > >GenerateReports.java. I'd check there and make sure I'm not passing in

    > something
    > >that won't parse to an int.
    > >
    > >HTH,
    > >
    > >Tom Duffy
    > >
    > >"Mark Sorteberg" <msorteberg@inspec.com> wrote:
    > >>
    > >>My Java code compiles fine, but when I go to run it I get this message:
    > >>
    > >>Exception in thread "main" java.lang.NumberFormat Exception: null
    > >> at java.lang.Integer.parseInt(Integer.java:377)
    > >> at java.lang.Integer.parseInt(Integer.java:458)
    > >> at GenerateReports.<init>(GenerateReports.java:217)
    > >> at GenerateReports.main(GenerateReports.java, Compiled Code)
    > >>
    > >>Any help would be appreciated.

    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center