• Post Reply Bookmark Topic Watch Topic
  • New Topic

Number Format Exceptions in java classes  RSS feed

 
Bryce Martin
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm programming a web application and when I debug it and I'm stepping through it my debugger jumps into the core numeric classes with a lot of number format exceptions. I was wondering if I'm not defining something properly or if this is normal behavior? I get no adverse results, no compiler warnings, no compiler errors, but the debugger seems to go on a rampage and jumps out of the code that I've written and off into these core numeric classes. I don't exactly know how to keep the debugger from going into them.

I'm programming in WDSC 7.0. Any thoughts? Are any of these exceptions seen by the debugger slowing down my application? Is there any way to stop them?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a runtime error caused by the attempted conversion of an improperly-formatted String to a numeric type. The point where the debugger jumped into the standard Java library should indicate where the problem lies.
 
Bryce Martin
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean by improperly formatted? How do you improperly format a string? Its a string....

Why don't I get any runtime error message? Shouldn't I see something in my console that would indicate this?
 
Joe Ess
Bartender
Posts: 9443
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bryce Martin:
How do you improperly format a string? Its a string....


Roger means that the string is improperly formatted to be converted into a number. "blah" is improperly formatted. "100" is properly formatted.
 
Bryce Martin
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But this stuff happens on my first page that I call Selection.jsp

I don't do any of that, its only HTML and JavaScript. There is no java associated with the page, yet when its loading it goes off on a tangent.

Any thoughts?
 
Joe Ess
Bartender
Posts: 9443
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.jsp files get turned into java servlets, so yes, there's java associated with that page.
Do you have this same problem when you load the page without the debugger?
Can you cut and paste the stack trace so we can see what you are seeing?
 
Bryce Martin
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I load without the debugger I get no messages, no warnings, no errors. The page loads flawlessly and everything is fine. I just noticed this phenomenon when I was debugging one of my classes last week.

I understand that jsp's are java. And I'm using servlets to interact with my JSPs. There is no servlet interacting with my Selection.jsp until I submit the form. So do you think that its nothing? Should I not really worry about it since there are no ill affects? Its just a curiosity I had. I didn't know if there was something I could do to help the JVM create the container without these exceptions. I'll try to debug it tomorrow and screenshot what I'm seeing or give some stack traces from my debugger.

Thanks for your time.
Bryce
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you see a stack trace anywhere for this exception? Can you reprint it here? Or perhaps your debugger shows a list of the frames you're in when the exception is thrown. That would be useful to see.
 
Bryce Martin
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While poking around my debugger I noticed that it is set to break on NullPointer Exception caught/uncaught, NumberFormat Exceptions caught/uncaught, and SQL Exceptions caught/uncaught. Now I'm guessing that the wonderful people who programmed these classes realize that in certain situations for whatever reasons there may be certain exceptions occurring. So they caught and handled as many as they could. It seems that its the container that is producing these caught exceptions and causing the debugger to break its action.



Here is what my first stack looks like when I run my Selection.jsp in debug mode. This happens during the building of the container it seems... if I step into it then it goes into java's NullPointerException class and then into the RuntimeException class.

It seems to be happening within the method ClauseTable.get(Int):line 55.

This is in the Container thread so I'm guessing its nothing that I'm doing, that its the way my JVM is handling things.

It seems that the container is having some problems handling a DNS name to IP address lookup. Its giving a caught NumberFormatException...Here is the stack...



The values its taking in are arg0: "csas400, arg1: 10. Its supposed to be taking a string as arg0 and an int as arg1 so I don't know what the problem is. I'm certain its just the container and not anything that I'm doing. So if things run ok I don't think I'm going to worry about it. I would probably have to call IBM and talk to their JVM programmers about it and I don't really feel like getting into this stuff with them right now.

Thanks for any suggestions and taking the time to look at this for me.

Bryce
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!