File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes NumberFormatException:  D - what's this D? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "NumberFormatException:  D - what Watch "NumberFormatException:  D - what New topic

NumberFormatException: D - what's this D?

Tina Desai
Ranch Hand

Joined: Mar 13, 2003
Posts: 365
Hi Friends,
I got the following Exception. What does D mean in it?
Unable to compile class for JSP : java.lang.NumberFormatException: D
at java.lang.Integer.parseInt( Code))
at java.lang.Integer.parseInt( Code))
at org.apache.jasper.compiler.Compiler.getJspLineErrors(
at org.apache.jasper.compiler.Compiler.compile(
at org.apache.jasper.runtime.JspServlet.loadJSP(
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(
at org.apache.jasper.runtime.JspServlet.serviceJspFile(
at org.apache.jasper.runtime.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
I searched on google to get a hint that when Exception e.getMessage() has double colon in it, the jasper cannot parse it properly and eats up the line number in display.
Im clueless from where the error is coming.
Any suggestions?

Alongwith being a good coder, try to be a good professional as well!
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
The "D" is the value that was passed into Integer.parseInt(). It's not a value on its own, so it can't parse it. If you want to parse a double (i.e. using a trailing "D" or "d") such as "3.141592654D" consider Double.parseDouble() instead...

"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The team, Newsletter 039.
Balan Raj
Ranch Hand

Joined: Aug 26, 2003
Posts: 74
Looks like the String being parsed as number is "D".
I'm not familiar with Jasper, but is there a way to get the compiled Java file?
Tina Desai
Ranch Hand

Joined: Mar 13, 2003
Posts: 365
No! I do not have something getting passed as D!
Its not a varibale either..
How can I get the compiled java class for the JSP when it says its unable to compile!
Im just getting the exception!
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
Could you post your jsp code for us to look at?

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

better paste your JSP here

Tina Desai
Ranch Hand

Joined: Mar 13, 2003
Posts: 365
Sorry, I cannot paste my JSPs here.
Also, the JSP which did not compile and gave this exception includes several others. so would not be able to paste them all here.
I could not pin point the exact problem.
Got files from a colleagues PC where it worked.
A goole search gave me -
Does that mean in the ex.getMessage()if I have a double colon, it eats up the line no at which error occured?
Thanks and Regards,
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5382
Originally posted by Tina Desai:
How can I get the compiled java class for the JSP when it says its unable to compile!

If you are using Tomcat then you can see the generated java file in the "work" folder.
exa: webapps/YOUR_APP/work
this is default, if you have not specified workDir attribute of Context.

"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
I agree. Here's the link:
subject: NumberFormatException: D - what's this D?
jQuery in Action, 3rd edition