Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NumberFormatException: D - what's this D?

 
Tina Desai
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Balan Raj
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post your jsp code for us to look at?
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
better paste your JSP here
 
Tina Desai
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic