kazu2012 / persevere-framework

Automatically exported from code.google.com/p/persevere-framework
0 stars 0 forks source link

NumberFormatException when POST JSON data is malformed. #223

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. POST request to any URI (/Class, for example) with minus (the character '-') 
as the data.

        POST /Class '-'

What is the expected output? What do you see instead?
Expect 400 Bad Request, maybe. Get 500 Internal Server Error, and NFE.

What version of the product are you using? On what operating system?
Using svn r571 on OSX.

Please provide any additional information below.
Stack trace:

js>Jul 27, 2009 8:17:30 PM org.persvr.remote.PersevereFilter$DefaultHandler 
callWARNING:
java.lang.NumberFormatException: For input string: "-"        at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)   
     at 
java.lang.Integer.parseInt(Integer.java:474)        at 
java.lang.Integer.valueOf(Integer.java:553)        
at org.persvr.util.JSONParser.number(JSONParser.java:554)        at 
org.persvr.util.JSONParser.read(JSONParser.java:357)
        at org.persvr.util.JSONParser.read(JSONParser.java:315)
        at org.persvr.util.JSONParser.read(JSONParser.java:323)
        at org.persvr.util.JSON.parse(JSON.java:19)        at 
org.persvr.remote.JsonReceiver.parseJsponString(JsonReceiver.java:36)        at 
org.persvr.remote.PersevereFilter$DefaultHandler.call(PersevereFilter.java:683)
        at org.persvr.remote.PersevereFilter.doFilter(PersevereFilter.java:357)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
        ... (the rest is just jetty)

Original issue reported on code.google.com by Micha.Ni...@gmail.com on 28 Jul 2009 at 12:23

GoogleCodeExporter commented 8 years ago

Original comment by kris...@gmail.com on 28 Jul 2009 at 2:01