jersey 2.0 - jersey2 unable to return response object -


i'm using dropwizard , jersey2 rest client ,

javax.ws.rs.badrequestexception: http 400 bad request 

however, when turn on logging see

debug [2016-04-25 05:17:10,196] org.apache.http.wire: http-outgoing-0 << "{"apiversion":"v1","timestamp":"april 24, 2016, 10:17 pm","error":{"asierrorcode":"12002","message":"a message","moreinfo":"http:\/\/bar.foo.net"}}" info  [2016-04-25 05:17:10,197] unknown.jul.logger: 1 * client response received on thread main 1 < 400 1 < access-control-allow-headers: accept, content-type, authorization 1 < access-control-allow-methods: get, post, put, delete 1 < access-control-allow-origin: * 1 < allow: options,get,post,put,delete 1 < cache-control: no-cache, no-store, must-revalidate 1 < connection: close 1 < content-length: 265 1 < content-type: application/json 1 < date: mon, 25 apr 2016 05:17:10 gmt 1 < expires: 0 1 < pragma: no-cache 1 < server: apache/2.4.12 (win32) openssl/1.0.1m mod_jk/1.2.40 php/5.6.14 {"apiversion":"v1","timestamp":"april 24, 2016, 10:17 pm","error":{"asierrorcode":"12002","message":"a message","moreinfo":"http:\/\/foo.bar.net"}} 

how can deserialize response instead of getting 400?

my code looks like

return client.target(url).get(asiaccounts.class); 

and asiaccounts empty

@jsonignoreproperties public class asiaccounts   } 

i added apiverson, timestamp , error asiaccounts still doesn't work. appreciated.

you can use way

response.status(200).entity(asiaccount).build(); 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -