I have a problem regarding to MessageBodyWriter

I have two custom "provider"s

public class WriterListABC implements MessageBodyWriter<List<ABC>>
public class WriterListInteger implements MessageBodyWriter<List<Integer>>

ABC is my custom class

When I return a List<Integer> , it seems it will find WriterListABC ,
not WriterListInteger
and it throws "cannot cast Integer to ABC ..." exception.
It seems it is because java's generics is runtime type-erasure....
But how to solve this problem ?

Reply via email to