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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:05:10+00:00 2026-06-06T09:05:10+00:00

ive got this exception. My Object looks like this: @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class ObjectDTO

  • 0

ive got this exception.

My Object looks like this:

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class ObjectDTO implements Serializable {

/**
 * 
 */
private static final long serialVersionUID = -8545841080597549468L;

@XmlElement(name="objectId")
private String objectId;
@XmlElement(name="owner")
private String owner;
@XmlElement(name="objectName")
private String objectName;

Constructor, getter/setter, toString, Hash...

Now I invoke my service method with:

 ClientResponse postRes = service.path("rest").path("object").accept(MediaType.APPLICATION_XML).post(ClientResponse.class, object);

When I do

 System.out.println(postRes.getEntity(ObjectDTO.class));

it works fine. But when I try to do a get operation on my object like:

 String string = postRes.getEntity(ObjectDTO.class).getObjectId();

I get the exception.

 javax.ws.rs.WebApplicationException: javax.xml.bind.UnmarshalException - with linked exception: [org.xml.sax.SAXParseException: Premature end of life.]  

Whats wrong?

  • 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-06T09:05:11+00:00Added an answer on June 6, 2026 at 9:05 am

    Looks like you are trying to read the entity twice (the second time the entity stream is already consumed). Instead of calling postRes.getEntity() twice, call it just once, store the result in a variable and then operate on that variable.

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

Sidebar

Related Questions

ive got an object that looks like this with print_r(): SimpleDOM Object ( [0]
I've got this code: public class CodeContractSample { private readonly List<object> _items = new
ive got this class it has one 2dArray and when im trying to fill
Hello I'm doing some tests using reflection... so far I've got this: public class
I want to serialize an object. I've got this basic class structure: class Controller
I've got a model defined in my Django app foo which looks like this:
Ive got this problem: Line 20 (LOOT_FromContainer(container) I need that to use as Invoke
Well ive got this code that creates a table from JSON data. If a
I've got this code: function drawing(){ this.dragging = function(){ $('#object').mousedown(startDragging); } function startDragging(){ console.log(e.PageX);
Ive got some kind of a problem here. When I try this function, it

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.