Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8788831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:14:07+00:00 2026-06-13T22:14:07+00:00

not sure whats going on, the full error is: Problem with i/o No serializer

  • 0

not sure whats going on, the full error is:

Problem with i/o No serializer found for class org.json.JSONObject and no properties        discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) )

I am trying to send a PUT request to a RESTful service. I am parsing a POST And sending modified key/value pairs for ‘ID’ and ‘enabled’ for the PUT.

@Test(dependsOnMethods= {"Post"})
public void Put() throws IOException  {

logger.logTestActivity("Testing FORM data POST using Excel file");
requestBuilder = new RequestSpecBuilder();

String jsonString = "";
boolean enabledModify = false;

try {
 BufferedReader in = new BufferedReader(new FileReader(
 xmlTest.getParameter("json-post")));

String str;

while ((str = in.readLine()) != null) {
      jsonString += str;
        }

JSONObject jsonObjPut = new JSONObject(jsonString);
jsonObjPut.put("_id", createUserId);
jsonObjPut.put("enabled",enabledModify);

    System.out.println(jsonObjPut.toString());
in.close();

    requestBuilder.setContentType(ContentType.JSON);
    requestSpecification = requestBuilder.build();
    responseBuilder.expectStatusCode(Integer.parseInt(xmlTest
    .getParameter("http-status-code-200")));
    responseBuilder.expectContentType(ContentType.JSON);
    responseSpecification = responseBuilder.build();    
System.out.println(createUserId);

String responseJson = given().body(jsonObjPut).         
when().put("/" + createUserId).asString();

    System.out.println(responseJson);

logger.logTestActivity("Finished testing FORM data POST using Excel file");
} catch (AssertionError e ) {
  logger.logTestActivity(
        "Error testing FORM data post: " + e.getMessage(),logger.ERROR);

      System.out.println("REST URL: " + RestAssured.baseURI + " "
                + RestAssured.port + " " + RestAssured.basePath );
  Assert.fail("Error testing FORM data POST: " + e.getMessage());
        throw e;
} catch (IOException | JSONException e) {
   System.out.println("Problem with i/o" + e.getMessage()); 
    }
}

createUserID is a global variable that is the ID parsed from the POST.

JSON file that is getting parsed looks like this:

{
"enabled" : false,
"_id" : "fdse332a-22432d-4432b"
}

In a before test method I am setting up the restassured with all the appropriate url endpoints…

Also, the PUT is also failing, with a NULLPointerException Error. That may be another post in the future!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:14:09+00:00Added an answer on June 13, 2026 at 10:14 pm

    Solution: I was not converting my JSON object to a string when passing to restassured.

    String responseJson = given().body(jsonObjPut.toString).
    

    This did the trick. I now modify my existing json with generated ID and do a successful PUT on the RESTful service.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure whats going on here, or what could be the integer in this
Not sure what's going on here, but my iPhone apps nav bar shows back
Not sure what's going on here... My controller methods looks like this: [HttpGet] public
I'm not sure what's going on, but on my own laptop, everything works okay.
I'm not sure what's going on here but here's a section I'm having problems
CSS is not my strong suit, and I am not sure what's going on
Not too sure what's going on here as this doesn't seem like standard practise
I'm not too sure what's going on here but I'm trying to echo a
I'm not quite sure what's going on, but several issues are occurring on our
I am not sure if what I am going to ask is actually an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.