<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt">Just found the root cause. This error message came from Jersey library.<br>It's working fine now.<br><br>Thanks,<br>Vicky<br><div><span><br></span></div><div style="display: block;" class="yahoo_quoted"> <br> <br> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Wednesday, March 26, 2014 6:41:48 PM, Vicky Zheng <vickyzheng@yahoo.com> wrote:<br> </font> </div> <div class="y_msg_container"><div id="yiv6252029118"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande,
sans-serif;font-size:12pt;">Hi Andy,<br clear="none"> You are right. I do use accept() for other method call. The reason I use type() instead of accept() because the type call return another error message "Your payload must be sent with the media type: application/xml</message></additionalInfo><code>E_BAD_REQUEST</code><components/><message>Cannot consume content type".<br clear="none"> Here is the code: response = webResource.accept(MediaType.APPLICATION_XML).post(ClientResponse.class, pocPayload);<br clear="none"> Please advise.<br clear="none"><br clear="none">Thanks,<br clear="none">Vicky <br clear="none"><div><span><br clear="none"></span></div><div class="yiv6252029118yahoo_quoted" style="display:block;"> <br clear="none"> <br clear="none"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div
style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div class="yiv6252029118yqt6257274864" id="yiv6252029118yqtfd34750"><div dir="ltr"> <font face="Arial" size="2"> On Wednesday, March 26, 2014 4:37:26 PM, Andy Newton <andy@arin.net> wrote:<br clear="none"> </font> </div> <div class="yiv6252029118y_msg_container"><div id="yiv6252029118"><div>
<div>Hi Vicky,</div>
<div><br clear="none">
</div>
<div>That error appears to be generated because our servers are receiving the request with an Accept header of “text/html” and not “application/xml”.</div>
<div><br clear="none">
</div>
<div>While I am not familiar with the toolkit you are using, my guess is that the working code is using webResource.accept( MediaType.APPLICATION_XML ) and the other code is using webResource.type( MediaType.APPLICATION_XML ).</div>
<div><br clear="none">
</div>
<div>Andy Newton,</div>
<div>Chief Engineer, ARIN</div>
<div><br clear="none">
</div>
<span id="yiv6252029118OLK_SRC_BODY_SECTION">
</span><div class="yiv6252029118yqt2635053528" id="yiv6252029118yqt58331"><div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt;">
<span style="font-weight:bold;">From: </span>Vicky Zheng <<a rel="nofollow" shape="rect" ymailto="mailto:vickyzheng@yahoo.com" target="_blank" href="mailto:vickyzheng@yahoo.com">vickyzheng@yahoo.com</a>><br clear="none">
<span style="font-weight:bold;">Reply-To: </span>Vicky Zheng <<a rel="nofollow" shape="rect" ymailto="mailto:vickyzheng@yahoo.com" target="_blank" href="mailto:vickyzheng@yahoo.com">vickyzheng@yahoo.com</a>><br clear="none">
<span style="font-weight:bold;">Date: </span>Wednesday, March 26, 2014 at 3:03 PM<br clear="none">
<span style="font-weight:bold;">To: </span>Andrew Newton <<a rel="nofollow" shape="rect" ymailto="mailto:andy@arin.net" target="_blank" href="mailto:andy@arin.net">andy@arin.net</a>>, "<a rel="nofollow" shape="rect" ymailto="mailto:arin-tech-discuss@arin.net" target="_blank" href="mailto:arin-tech-discuss@arin.net">arin-tech-discuss@arin.net</a>" <<a rel="nofollow" shape="rect" ymailto="mailto:arin-tech-discuss@arin.net" target="_blank" href="mailto:arin-tech-discuss@arin.net">arin-tech-discuss@arin.net</a>><br clear="none">
<span style="font-weight:bold;">Subject: </span>Re: [arin-tech-discuss] How to solve the exception with "Could not find JAXBContextFinder for media type: textml"<br clear="none">
</div>
<div><br clear="none">
</div>
<blockquote id="yiv6252029118MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5;">
<div>
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
Sorry, the error message should be:<br clear="none">
HTTP Status 500 - Could not find JAXBContextFinder for media type: text/html<br clear="none">
The server encountered an internal error (Could not find JAXBContextFinder for media type: text/html) that prevented it from fulfilling this request<br clear="none">
<br clear="none">
<br clear="none">
Thanks,<br clear="none">
Vicky<br clear="none">
<div><span></span></div>
<div class="yiv6252029118yahoo_quoted" style="display:block;"><br clear="none">
<br clear="none">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div dir="ltr"><font face="Arial" size="2">On Wednesday, March 26, 2014 2:33:41 PM, Vicky Zheng <<a rel="nofollow" shape="rect" ymailto="mailto:vickyzheng@yahoo.com" target="_blank" href="mailto:vickyzheng@yahoo.com">vickyzheng@yahoo.com</a>> wrote:<br clear="none">
</font></div>
<div class="yiv6252029118y_msg_container">
<div id="yiv6252029118">
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
Thanks Andy for the response. My confuse is in my code, I did put the type is "MediaType.APPLICATION_XML".<br clear="none">
Don't get why the server get this exception.<br clear="none">
I used the following code to get Poc and it is working fine.<br clear="none">
public String getPOC(String pocHandle)throws Exception{<br clear="none">
config = new DefaultClientConfig();<br clear="none">
client = Client.create(config);<br clear="none">
String pocPayLoad = null;<br clear="none">
try{<br clear="none">
webResource = client.resource("<a rel="nofollow" shape="rect" target="_blank" href="https://reg.arin.net/rest/poc/">https://reg.arin.net/rest/poc/"+pocHandle+"?apikey="+getAPIkey()</a>);<br clear="none">
pocPayLoad = webResource.accept(MediaType.APPLICATION_XML).get(String.class);<br clear="none">
}catch(Exception e){<br clear="none">
logger.info("Exception:"+e.getMessage());<br clear="none">
}<br clear="none">
return pocPayLoad;<br clear="none">
}<br clear="none">
<br clear="none">
Thanks,<br clear="none">
Vicky<br clear="none">
<div><span><br clear="none">
</span></div>
<div class="yiv6252029118yqt8566868254" id="yiv6252029118yqt61491">
<div class="yiv6252029118yahoo_quoted" style="display:block;"><br clear="none">
<br clear="none">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div dir="ltr"><font face="Arial" size="2">On Wednesday, March 26, 2014 2:09:51 PM, Andy Newton <<a rel="nofollow" shape="rect" ymailto="mailto:andy@arin.net" target="_blank" href="mailto:andy@arin.net">andy@arin.net</a>> wrote:<br clear="none">
</font></div>
<div class="yiv6252029118y_msg_container">
<div id="yiv6252029118">
<div>
<div>Hi Vicky,</div>
<div><br clear="none">
</div>
<div>By looking at your code snippet, my guess is that the media type is not being registered properly with JAXB. “textml” is not a valid media type as far as I know. The media type to use with Reg-RWS is “application/xml”.</div>
<div><br clear="none">
</div>
<div>I hope this helps.</div>
<div><br clear="none">
</div>
<div>Andy Newton,</div>
<div>Chief Engineer, ARIN</div>
<div><br clear="none">
</div>
<span id="yiv6252029118OLK_SRC_BODY_SECTION"></span>
<div class="yiv6252029118yqt8795740544" id="yiv6252029118yqt70028">
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt;">
<span style="font-weight:bold;">From: </span>Vicky Zheng <<a rel="nofollow" shape="rect" ymailto="mailto:vickyzheng@yahoo.com" target="_blank" href="mailto:vickyzheng@yahoo.com">vickyzheng@yahoo.com</a>><br clear="none">
<span style="font-weight:bold;">Reply-To: </span>Vicky Zheng <<a rel="nofollow" shape="rect" ymailto="mailto:vickyzheng@yahoo.com" target="_blank" href="mailto:vickyzheng@yahoo.com">vickyzheng@yahoo.com</a>><br clear="none">
<span style="font-weight:bold;">Date: </span>Wednesday, March 26, 2014 at 1:52 PM<br clear="none">
<span style="font-weight:bold;">To: </span>"<a rel="nofollow" shape="rect" ymailto="mailto:arin-tech-discuss@arin.net" target="_blank" href="mailto:arin-tech-discuss@arin.net">arin-tech-discuss@arin.net</a>" <<a rel="nofollow" shape="rect" ymailto="mailto:arin-tech-discuss@arin.net" target="_blank" href="mailto:arin-tech-discuss@arin.net">arin-tech-discuss@arin.net</a>><br clear="none">
<span style="font-weight:bold;">Subject: </span>[arin-tech-discuss] How to solve the exception with "Could not find JAXBContextFinder for media type: textml"<br clear="none">
</div>
<div><br clear="none">
</div>
<blockquote id="yiv6252029118MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5;">
<div>
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div>Hello,</div>
<div> I created java function to call Arin service to add Poc payload. The XML string come from Arin web sample.
<br clear="none">
</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
I'm receiving the response from Arin service with "Could not find JAXBContextFinder for media type: text<img>ml.</div>
<div>JBoss Web/7.0.10.Final <br clear="none">
The server encountered an internal error (Could not find JAXBContextFinder for media type: text<img>ml) that prevented it from fulfilling this request.<br clear="none">
</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
".</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
Could any one please give me a hint what's the root cause?</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
Here is the java function</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
public void addPoc()<br clear="none">
</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
{</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
config = new DefaultClientConfig();<br clear="none">
client = Client.create(config);<br clear="none">
webResource = client.resource("<a rel="nofollow" shape="rect" target="_blank" href="https://reg.arin.net/rest/poc;makeLink=true">https://reg.arin.net/rest/poc;makeLink=true"+"?apikey="+getAPIkey()</a>);<br clear="none">
response = webResource.type(MediaType.APPLICATION_XML).post(ClientResponse.class, pocPayload);<br clear="none">
String rePocPayLoad = response.getEntity(String.class);<br clear="none">
return rePocPayLoad;<br clear="none">
</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
}</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
<br clear="none">
</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
<br clear="none">
</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
Thanks!</div>
<div style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">
Vicky<br clear="none">
</div>
</div>
</div>
</div>
</blockquote>
</div>
<div><br clear="none">
</div>
<div><br clear="none">
</div>
</div>
</div>
<br clear="none">
<br clear="none">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br clear="none">
<br clear="none">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote></div>
<div><br clear="none">
</div>
<div><br clear="none">
</div>
</div></div><br clear="none"><br clear="none"></div> </div></div><div class="yiv6252029118yqt6257274864" id="yiv6252029118yqtfd69641"> </div></div><div class="yiv6252029118yqt6257274864" id="yiv6252029118yqtfd96078"> </div></div><div class="yiv6252029118yqt6257274864" id="yiv6252029118yqtfd53265"> </div></div></div></div><br>_______________________________________________<br clear="none">arin-tech-discuss mailing list<div class="yqt6257274864" id="yqtfd23669"><br clear="none"><a shape="rect" ymailto="mailto:arin-tech-discuss@arin.net" href="mailto:arin-tech-discuss@arin.net">arin-tech-discuss@arin.net</a></div><br clear="none"><a shape="rect" href="http://lists.arin.net/mailman/listinfo/arin-tech-discuss" target="_blank">http://lists.arin.net/mailman/listinfo/arin-tech-discuss</a><div class="yqt6257274864" id="yqtfd53271"><br clear="none"></div><br><br></div> </div> </div> </div> </div></body></html>