aspose file tools*
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
Author

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(Integer.java(Compiled Code))
at java.lang.Integer.parseInt(Integer.java(Compiled Code))
at org.apache.jasper.compiler.Compiler.getJspLineErrors(Compiler.java:472)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:697)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:244)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:430)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:565)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
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?
Cheers!
Tina


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 JavaPerformanceTuning.com 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!
Tina
Carl Trusiak
Sheriff

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: 8919

better paste your JSP here


Groovy
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 -
this
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,
Tina
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
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: http://aspose.com/file-tools
 
subject: NumberFormatException: D - what's this D?