Arul Dhesiaseelan wrote:
Hi,

I was using a recent snapshot of 2.1. When I tried to compile the JAX_RS sample, it failed. After looking at the source code, I see SingletonResourceProvider no longer has a default constructor. I fixed the Server.java in the sample as shown below.

       JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
       sf.setResourceClasses(CustomerService.class);
sf.setResourceProvider(CustomerService.class, new SingletonResourceProvider(new CustomerService()));
       sf.setAddress("http://localhost:9000/";);

       sf.create();

After this, when I run the client it fails with the following HTTP-500 internal error.

client:
    [java] Sent HTTP GET request to query customer info
[java] Exception in thread "main" java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:9000/customerservice/customers/123

[java] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Ht
tpURLConnection.java:1241)
    [java]     at java.net.URL.openStream(URL.java:1009)
    [java]     at demo.jaxrs.client.Client.main(Client.java:52)
    [java] Java Result: 1


This used to work earlier.

Can someone help understand this error?

Thank you
Arul


_________________________________________________
Scanned by MessageLabs for the Super Flux Friends
_________________________________________________
Can someone clarify this issue?

Thank you
Arul

Reply via email to