Hi Aditya,
you right. What you need is to implement a new entity provider
for your Address class. Another option is to return an object of a class
which already has an entity provider implemented (e.g. String, JAXB object, JSON object).
At
http://blogs.sun.com/sandoz you can see how to implement a new entity provider.
~Jakub
On Tue, Aug 07, 2007 at 03:47:52PM +0530, Aditya Gore wrote:
> Hi All,
>
> I am trying to write a simple address book app using jersey. My
> application right now is a simple resource class that supports only
> GET and returns an array of hardcoded Address objects. An Address
> object is a very simple object with just 2 methods returning Strings
> (getHouse() and getStreet()). On executing a GET I see the error
> below. Please can someone point out where I am going wrong?
>
>
> java.lang.IllegalArgumentException: A entity provider for type, class
> [Laddressbook.resources.Address;, is not supported
> at com.sun.ws.rest.impl.provider.ProviderFactoryImpl.createEntityProvider(ProviderFactoryImpl.java:67)
> at com.sun.ws.rest.impl.container.httpserver.HttpServerResponseAdaptor.commit(HttpServerResponseAdaptor.java:66)
> at com.sun.ws.rest.impl.container.httpserver.HttpHandlerContainer.handle(HttpHandlerContainer.java:64)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
> at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:556)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:528)
> at sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:125)
> at sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:353)
> at sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:327)
> at java.lang.Thread.run(Thread.java:619)
>
> thanks,
> :aditya
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>