AndroidAnnotations @REST: The converter class must be a subtype of org.springframework.http.converter.HttpMessageConverter RestClient.java

StackOverflow https://stackoverflow.com/questions/18987978

Question

I want create a REST client using AndroidAnnotations

When define converters on @Rest annotation, I receive the following compile error:

The converter class must be a subtype of org.springframework.http.converter.HttpMessageConverter RestClient.java

I use this libraries:

/libs

androidannotations-api-2.7.1.jar
gson-2.2.4.jar
jackson-core-asl-1.9.13
jackson-asl-0.9.5
jackson-mapper-asl-1.9.13
spring-android-auth-1.0.1.RELEASE.jar
spring-android-core-1.0.1.RELEASE.jar
spring-android-rest-template-1.0.1.RELEASE.jar

/compile-libs

androidannotations-2.7.1.jar

My source is similar to the example androidannotations

package com.sinffredy.spring;

import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter;
import com.googlecode.androidannotations.annotations.rest.Get;
import com.googlecode.androidannotations.annotations.rest.Rest;


@Rest(rootUrl = "http://my.url/ajax/services", converters = { MappingJacksonHttpMessageConverter.class })
public interface RestClient 
{
     @Get("/.do?valor={search}")
     Respuesta getRespuesta(String search);
}

Thanks in advance !!!

Était-ce utile?

La solution

I solved it!!! Only change my Eclipse. I was using Helios with Android Development Toolkit

Now I dowload The Android SDK than includes Eclipse + ADT plugin. Use my old workspace with my proyect and all work fine!!!.

Autres conseils

It seems to be the same issue than this one. Sadly I still can't reproduce this bug.

Just to be sure, could you test by adding spring-android-rest-template in your annotation processing factory path ?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top