Daan/Antonio,

In the latest master API Async job dispatching is broken for all the jobs 
containing Map<String,String> parameter (createTag/createNetworkOffering for 
example). You get exception like this:

2014-02-06 14:06:44,633 DEBUG [c.c.a.ApiServlet] 
(885544708@qtp-863633905-7:ctx-629dec4f ctx-5f2657ab) ===END===  
0:0:0:0:0:0:0:1 -- GET  
command=queryAsyncJobResult&jobId=0da676a6-8a56-4a85-9674-22e006560f30&response=json&sessionkey=Q0v%2B4qZKxVcDEnu3ibXNBT7B5xo%3D&_=1391724404610
2014-02-06 14:06:44,729 ERROR [c.c.a.ApiAsyncJobDispatcher] 
(Job-Executor-4:ctx-70ea00dd) Unexpected exception while executing 
org.apache.cloudstack.api.command.user.tag.CreateTagsCmd
com.google.gson.JsonParseException: The JsonDeserializer 
com.cloud.api.StringMapTypeAdapter@7a29f267 failed to deserialize json object 
{"tags":{"0":{"value":"alena","key":"alena"}},"response":"json","sessionkey":"Q0v+4qZKxVcDEnu3ibXNBT7B5xo=","cmdEventType":"CREATE_TAGS","ctxUserId":"2","command":"createTags","httpmethod":"GET","resourcetype":"Network","_":"1391724381502","ctxAccountId":"2","ctxStartEventId":"5168","resourceids":"79a96866-a304-4598-9e86-cc05225331ff"}
 given the type java.util.Map<java.lang.String, java.lang.String>
        at 
com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:64)
        at 
com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:92)
        at 
com.google.gson.JsonDeserializationVisitor.visitUsingCustomHandler(JsonDeserializationVisitor.java:80)

Caused by: java.lang.UnsupportedOperationException
        at com.google.gson.JsonElement.getAsString(JsonElement.java:184)
        at 
com.cloud.api.StringMapTypeAdapter.deserialize(StringMapTypeAdapter.java:39)
        at 
com.cloud.api.StringMapTypeAdapter.deserialize(StringMapTypeAdapter.java:30)
        at 
com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:51)
        ... 26 more


The error behavior is caused by commit below. Haven't debugged in so can't give 
you more details on which line change causes the failure, but after reverting 
the commit, stuff started working normal.

commit 447430c3df38c36d947c44c4aebd961d8cbb14c4
Author: Antonio Fornie <afor...@schubergphilis.com>
Date:   Fri Jan 31 02:28:57 2014 +0100

    CLOUDSTACK-6003 fixing plus refactoring dispatcher

    Signed-off-by: Daan Hoogland <d...@onecht.net>
    (cherry picked from commit a9bcc1ea3b7dfd3fcc5c795b0095c77851ebe618)
    Signed-off-by: Daan Hoogland <d...@onecht.net>



I'm going to revert this as its a blocker bug for certain API commands. 
Daan/Antonio please revise it, and check it in only after testing  Api commands 
with all  possible parameters types.

Thanks,
Alena.

Reply via email to