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 8729765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:53:26+00:00 2026-06-13T08:53:26+00:00

I am trying to test my JSON based webservice using Junit client. I get

  • 0

I am trying to test my JSON based webservice using Junit client. I get a ClientHandlerException for not having no-arg default constructor' on my request object and its super class (AMessageStrategy). When I add theno-arg default constructorto both of them the server throws a exceptionNo suitable constructor found for type [simple type, class javax.xml.bind.JAXBElement]:`. This has put me in a fix.

Ideally I dont want/need to have a no-arg default constructor. The question is, is there a way around it. I just need to serialize a object to json. The object has 2 main fields, a message id and message data. The message data is a pojo.

I have added @XmlRootElement on the request class (no annotations on the fields though).

Please advice, I am kinda stuck. And I am a newbie on Java EE. Let me know if more information is needed on this.

com.sun.jersey.api.client.ClientHandlerException: javax.ws.rs.WebApplicationException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
com.mcruiseon.common.message.request.RegistrationRequest does not have a no-arg default constructor.
    this problem is related to the following location:
        at com.mcruiseon.common.message.request.RegistrationRequest
com.mcruiseon.common.message.AMessageStrategy does not have a no-arg default constructor.
    this problem is related to the following location:
        at com.mcruiseon.common.message.AMessageStrategy
        at com.mcruiseon.common.message.request.RegistrationRequest

    at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151)
    at com.sun.jersey.api.client.Client.handle(Client.java:648)
    at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
    at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
    at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
    at test.carpool4all.Registration.testPost(Registration.java:74)
  • 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-13T08:53:27+00:00Added an answer on June 13, 2026 at 8:53 am

    RegistrationRequest is not a POJO. Ideally it should be a POJO for it to work.

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

Sidebar

Related Questions

I am trying to test a sinatra app using minitest and capybara but get
i'm trying to create a test module to test json encoding. i am having
I am having trouble trying to parse JSON with child nodes using jquery. I
I'm trying to send the node instance JSON data using an ajax get request
I'm trying to change the ID of an element here: http://moemonty.com/chirp/CHIRP-JSON-test.html By using this
Using Javascript I'm trying to test whether or not a DIV with the id
Im trying to test my successfully creates a new user after login (using authlogic).
I'm trying to test using SFML's full screen mode, however it crashes every time
I'm trying to test in-app billing using my own sku/product ID upgrade_to_premium. As I
using django 1.4, I am trying to Post and it seems like its not

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.