aspose file tools*
The moose likes Other Open Source Projects and the fly likes Getting IO exception with doPost is executed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Getting IO exception with doPost is executed" Watch "Getting IO exception with doPost is executed" New topic
Author

Getting IO exception with doPost is executed

Aditya Sirohi
Ranch Hand

Joined: Jan 05, 2010
Posts: 93

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

Joined: Mar 22, 2000
Posts: 12825
    
    5
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

Joined: Jan 05, 2010
Posts: 93

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

Joined: Jan 10, 2002
Posts: 61654
    
  67

That's not enough of the stack trace to be helpful. But it probably means your JSON is hosed.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Aditya Sirohi
Ranch Hand

Joined: Jan 05, 2010
Posts: 93

I guess my JSON file is messed up.
Aditya Sirohi
Ranch Hand

Joined: Jan 05, 2010
Posts: 93

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

Joined: Jan 10, 2002
Posts: 61654
    
  67

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

Joined: Jun 24, 2003
Posts: 3274
    
    5

Can you post the Stacktrace for the NPE please?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting IO exception with doPost is executed