Hello!

I'm having some problems using JAX-RS to publish endpoints. I took as
reference official documentation in following link, since I want to publish
it programatically without using Spring:

http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAX-RSendpointsprogrammaticallywithoutSpring


The RootResourceClass looks like this:


*@Path("/")*









*public class sampleClass {    @Path("/hello")    @GET
@Produces(MediaType.TEXT_PLAIN)    public String sayHello() {        return
"hello";    }}*

The endpoint was successfully published, since I could debug my code when I
accessed this URI. But for unknown reasons, server always response with an
internal server error. Please find an example of the request I did with
curl:


















* curl -H "Accept: text/plain" -X GET "http://localhost:8888/hello
<http://localhost:8888/hello>" -v* Hostname was NOT found in DNS cache*
Trying 127.0.0.1...* Connected to localhost (127.0.0.1) port 8888 (#0)> GET
/hello HTTP/1.1> User-Agent: curl/7.35.0> Host: localhost:8888> Accept:
text/plain> < HTTP/1.1 500 Server Error< Content-Length: 0< Connection:
close* Server Jetty(8.1.14.v20131031) is not blacklisted< Server:
Jetty(8.1.14.v20131031)< * Closing connection 0*

There's no helpful information in the response. Any idea on what could be
happening?

Thanks and best regards,

Adrián Roselló Rey

-- 




*Adrián Roselló Rey Distributed Applications and Networks Area (DANA) i2CAT
Foundation, Barcelona, Spain*
T: +34 93 553 25 49
http://dana.i2cat.net

Reply via email to