[ 
https://issues.apache.org/jira/browse/HBASE-9435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13778171#comment-13778171
 ] 

Devaraj Das commented on HBASE-9435:
------------------------------------

This broke one of our internal tests. The failing command:
{noformat}
 curl -H "Content-Type: application/json" --data '{"Row":{"@key":"cm93MQ==", 
"Cell":
{"@column":"Y29sZmFtOmNvbA==", "$":"dmFsdWUx"}
}}' http://localhost:17000/tcreatetbl/row1/colfam:col
{noformat}

The exception thrown:
{noformat}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 Can not deserialize instance of java.util.List out of 
START_OBJECT token
 at [Source: org.mortbay.jetty.HttpParser$Input@6392f558; line: 1, column: 2] 
(through reference chain: 
org.apache.hadoop.hbase.rest.model.CellSetModel["Row"])</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /tcreatetbl/row1/colfam:col. Reason:
<pre>    Can not deserialize instance of java.util.List out of START_OBJECT 
token
 at [Source: org.mortbay.jetty.HttpParser$Input@6392f558; line: 1, column: 2] 
(through reference chain: 
org.apache.hadoop.hbase.rest.model.CellSetModel["Row"])</pre></p><h3>Caused 
by:</h3><pre>org.codehaus.jackson.map.JsonMappingException: Can not deserialize 
instance of java.util.List out of START_OBJECT token
 at [Source: org.mortbay.jetty.HttpParser$Input@6392f558; line: 1, column: 2] 
(through reference chain: 
org.apache.hadoop.hbase.rest.model.CellSetModel["Row"])
        at 
org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)
        at 
org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:198)
        at 
org.codehaus.jackson.map.deser.CollectionDeserializer.handleNonArray(CollectionDeserializer.java:149)
        at 
org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:107)
        at 
org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:97)
{noformat}
                
> Fix jersey serialization/deserialization of json objects
> --------------------------------------------------------
>
>                 Key: HBASE-9435
>                 URL: https://issues.apache.org/jira/browse/HBASE-9435
>             Project: HBase
>          Issue Type: Bug
>          Components: REST
>            Reporter: Francis Liu
>            Assignee: Francis Liu
>             Fix For: 0.98.0, 0.96.1
>
>         Attachments: HBASE-9435.patch, HBASE-9435.patch
>
>
> Stargate uses the default json marshaller/unmarshaller in natural mode. In 
> this mode the unmarshaller has trouble unmarshalling json instances. 
> This patch fixes this issue by using jackson as the marshaller/unmarshaller 
> instead. 
> I've also updated all the model unit tests to test json 
> serialization/deserialization. Backwards compatibilty can be verified by 
> modify the test base class to use the original marshaller/unmarshaller and 
> see that model tests pass.
> The patch is backward compatible except for StorageClusterStatusModel, which 
> is broken anyway. It only shows one node in the liveNodes field.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to