• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting IO exception with doPost is executed

 
Aditya Sirohi
Ranch Hand
Posts: 93
Eclipse IDE Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am getting "Error 500: java.io.IOException:" when doPost is executed. I am new to servlet, can you let me know what i am doing wrong?

Thanks
Adi

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There should be a Stack trace with the exact line number in the log files. Without the line number we would just be guessing.

Bill
 
Aditya Sirohi
Ranch Hand
Posts: 93
Eclipse IDE Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello William,

The error is:-
Error 500: java.io.IOException: Unexpected character 'i' on line 1, column 3

-Adi
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not enough of the stack trace to be helpful. But it probably means your JSON is hosed.
 
Aditya Sirohi
Ranch Hand
Posts: 93
Eclipse IDE Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess my JSON file is messed up.
 
Aditya Sirohi
Ranch Hand
Posts: 93
Eclipse IDE Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my JSON File looks like below. I am getting a "Error 500: java.lang.NullPointerException", I guess because i am not parsing this file correctly in the doPost() method. Could you let me know what i am doing wrong in the doPost(). When i print the value of Sting "id", it value is 0.

-Aditya




 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At this point, it's all about the JSON parser you are using, not Servlets, so this post has been moved to a more appropriate forum.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the Stacktrace for the NPE please?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic