Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>1) Whoever is generating this error, is clearly expecting XML input. Not JSON. You need to change that ASAP:</p> <pre><code> javax.ws.rs.WebApplicationException: javax.xml.bind.UnmarshalException com.sun.istack.internal.SAXParseException2; &lt;= javax.xml.bind and SAXParse are both XML-only: JSON not invited </code></pre> <p>2) The stuff in your screen shot (presumably Jersey?) is definitely OK.</p> <p>3) I haven't followed the whole tutorial, and you haven't given enough information to tell where you went astray. </p> <p>SUGGESTION:</p> <p>Just retrace your steps in the tutorial, and make <em>sure</em> you're selecting "JSON" (<em>not</em> XML, and <em>not</em> SOAP) every step of the way.</p> <p>=========== ADDENDUM ===========</p> <p>OK - Thanx for the update. Here's where we're at:</p> <p>1) This is the problem:</p> <pre><code>Exception in thread "main" javax.ws.rs.WebApplicationException: javax.xml.bind.UnmarshalException - with linked exception: [com.sun.istack.internal.SAXParseException2; lineNumber: 0; columnNumber: 0; unexpected element (uri:"", local:"id"). Expected elements are &lt;{}person&gt;] at com.sun.jersey.core.provider.jaxb.AbstractListElementProvider.readFrom(AbstractListElementProvider.java:251) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:553) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:523) at soatestclient.SOATestClient.main(SOATestClient.java:33) Caused by: javax.xml.bind.UnmarshalException </code></pre> <p>2) You said this stack traceback is coming from the client.</p> <p>So your server is 100% OK - the <em>ONLY</em> thing you need to do is fix your client. Cool :)</p> <p>3) The traceback shows the client is expecting XML ... but getting JSON instead.</p> <p>So the <em>ONLY</em> thing you should need to fix is to tell your client "Hey: read JSON, not XML". Again - cool :)</p> <p>4) How do you do that?</p> <p>Well, for starters, you need to get rid of this line (if you haven't already):</p> <pre><code>// Bad, bad bad. Don't do this!| ClientResponse response = client.findAll_XML(ClientResponse.class); </code></pre> <p>5) You might want to change other parts of your client code - I don't know.</p> <p>You might also want to change your client's configuration - I don't know that, either.</p> <p>6) Suggestion: look at this other tutorial - it might point you in the right direction:</p> <ul> <li><a href="http://www.vogella.com/articles/REST/article.html" rel="nofollow">http://www.vogella.com/articles/REST/article.html</a></li> </ul> <p>NOTE:</p> <p><em>WHATEVER</em> you need to do - it should be <em>REALLY</em> simple! Please review the link, review your code and your test client configuration ... and post back what you find!</p> <p>Thank you in advance...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload