• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

returning a generic list from REST

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to write some generic code that simplifies things for other developers in my company.

I'm currently getting stuck returning a list of generic items from a REST web service



the getList1(..) method functions perfectly, but the moment I take the concrete class references out and try and replace them with generics ( getList.(..) ) i get the following exception from my webservice:

com.sun.jersey.api.client.ClientHandlerException: A message body reader for Java type, interface java.util.List, and MIME media type, application/xml, was not found




am I declaring my generic code incorrectly?

 
Tim Sparg
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apparently the problem is around type erasures...

anyway the solution i found was to use an Array instead of a List

reply
    Bookmark Topic Watch Topic
  • New Topic