Error on Rest Response: no suitable HttpMessageConverter

0

Hi,

When i run the above code, specially the last line.

JsRestClient js = new JsRestClient(); JsServerProfile server = new JsServerProfile("xxxxxxxxxxx","http://xxxxxxxxx.xxx.xxx:8080/jasperserver",null,"xxxxxxxxxxx","xxxxxxxxxxxxx"); js.setServerProfile(server); ServerInfo rt = js.getServerInfo();

I receive the folowing two errors

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxxxx.xxxxxx/com.xxxxx.xxxxxx.projeto.MainActivity}: org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class com.jaspersoft.android.sdk.client.oxm.server.ServerInfo] and content type [application/xml]
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
            at android.app.ActivityThread.access$600(ActivityThread.java:130)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4745)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class com.jaspersoft.android.sdk.client.oxm.server.ServerInfo] and content type [application/xml]
            at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:102)
            at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:549)
            at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:504)
            at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:269)
            at com.jaspersoft.android.sdk.client.JsRestClient.getServerInfo(JsRestClient.java:224)
            at com.jaspersoft.android.sdk.client.JsRestClient.getServerInfo(JsRestClient.java:209)
            at com.xxxxx.xxxxxx.relatorios.Relatorio.teste(Relatorio.java:19)
            at com.xxxxx.xxxxxx.projeto.MainActivity.onCreate(MainActivity.java:22)
            at android.app.Activity.performCreate(Activity.java:5008)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
            at android.app.ActivityThread.access$600(ActivityThread.java:130)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4745)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)

I tried diferent methods, but it looks like I am forgetting something.

I'm running Jasper Server CE 6.0.1

Thanks in advance.

Paulo

paulofbmarcon's picture
Joined: Jan 4 2011 - 7:09am
Last seen: 4 years 6 months ago

You will probably have a quicker response if you add this as an issue in the GitHub Repo https://github.com/Jaspersoft/jrs-rest-java-client

It should work fine with 6.0.1 do you have any redirects or proxy in front of your JasperServer?

marianol - 4 years 6 months ago

i will make some few more tests before post the correct answer, but it look like it's a problem with the SimpleFramework, so now I'm trying to figure out a way to import this library.

paulofbmarcon - 4 years 6 months ago

0 Answers:

No answers yet
Feedback