Results 1 to 7 of 7
  1. #1
    chandu14k is offline Member
    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0

    Default How can i do this???

    I have a code, which reads the data from log file (RequestCount, ResponseCount, FaultCount) and adds the data to it after compilation.
    Now i have a one other log file it has count, errorcount only. But when same code of java come here to read this file. It couldnt able to.
    Is there any option to declare like count = Requestcount in log file.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default

    So you're trying to use the same code that was written to read a file in one format, to read a file in a different format?
    Unless your code has a way of being informed about the structure of the file it is expected to parse then I don't see how...and that is entirely down to how you wrote your code.

  3. #3
    chandu14k is offline Member
    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0

    Default

    i am completely beginner to java, so i couldn't able to write the code. finally i tried some and i got this, but still am getting some errors.


    Can any body please help on this???
    Last edited by chandu14k; 08-10-2011 at 06:38 PM.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,574
    Rep Power
    23

    Default

    but still am getting some errors.
    Please copy and paste the full text of the error messages.

    Please edit your code and wrap it in code tags. See the #icon above the input box.

  5. #5
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default

    This cannot be your full error message as it does not show on which line the error occurs. You need to go to the line of code where the error does occur and see what is null and why it is null. Then you can fix it.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,574
    Rep Power
    23

    Default

    Please copy and paste the full text of the error messages.
    You have left off part of it. The missing part gives the source line number in your program.

    Please edit your code and wrap it in code tags. See the #icon above the input box.

    This line is very hard to read when yellow!!!
    props2.setProperty("RequestCount", this.currReqCount);

    What is the value of currReqCount ?
    Last edited by Norm; 08-10-2011 at 01:32 AM.

  7. #7
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default

    If you read the error message it is occurring in the put method of Hashtable. If you read the API for that method you would see that it throws a NullPointerException if either the key or value is null. Since your key is a String literal it is not possible for it to be null. Thus the value must be null. To confirm this add a print statement on the line before to display currReqCount.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •