[
https://issues.apache.org/jira/browse/WINK-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805561#action_12805561
]
Bryant Luk commented on WINK-246:
---------------------------------
I don't believe this is an issue from the JAX-RS 1.0 spec point of view.
Basically the request method matching stops because you have an @GET on the
getClichedMessage(). If on the other hand, you had something like:
{code}
@Path("/helloservice")
public class Hello {
@Path("/hello")
public World getClichedMesage() {
.....
return world;
}
}
{code}
{code}
public class World {
......
@GET
public World get() {
return this;
}
@GET
@Path("/name")
@Produces("text/plain")
public String getName() {
.....
}
}
{code}
that might work a bit better for you.
>From a JAX-RS spec point of view (3.7.2 Request Matching) for the 404 request,
>assume step 1 is complete. step 2(c)i adds in "getClichedMessage" as a
>possible sub-resource *method* (i.e. not locator since you have the @GET).
>step 2(d) second bullet removes "getClichedMessage" from the list of possible
>methods. Step 2(e) then gives you the 404.
> Problem(?) with JAXB based sub resource
> ---------------------------------------
>
> Key: WINK-246
> URL: https://issues.apache.org/jira/browse/WINK-246
> Project: Wink
> Issue Type: Bug
> Reporter: Davanum Srinivas
>
> With this sample, http://localhost:8080/jaxb-wink/rest/helloservice/hello
> shows me the xml i expect, but
> http://localhost:8080/jaxb-wink/rest/helloservice/hello/name fails with logs
> below.
> {code:title=Hello.java|borderStyle=solid}
> package org.apache.wink;
> import javax.ws.rs.GET;
> import javax.ws.rs.Path;
> import javax.ws.rs.Produces;
> @Path("/helloservice")
> public class Hello {
> @GET
> @Path("/hello")
> @Produces(javax.ws.rs.core.MediaType.APPLICATION_XML)
> public World getClichedMessage() {
> World world = new World();
> world.setName("Earth");
> world.setId(0);
> return world;
> }
> }
> {code}
> {code:title=World.java|borderStyle=solid}
> package org.apache.wink;
> import javax.ws.rs.GET;
> import javax.ws.rs.Path;
> import javax.ws.rs.Produces;
> import javax.ws.rs.core.MediaType;
> import javax.xml.bind.annotation.XmlRootElement;
> @XmlRootElement(name = "World")
> public class World {
> private long id;
> private String name;
> public long getId() {
> return id;
> }
> public void setId(long id) {
> this.id = id;
> }
> @GET
> @Path("/name")
> @Produces(MediaType.TEXT_PLAIN)
> public String getName() {
> return name;
> }
> public void setName(String name) {
> this.name = name;
> }
> }
> {code}
> {noformat}
> 220361 [http-8080-1] INFO org.apache.wink.server.internal.RequestProcessor -
> WebApplicationException (404 - Not Found) occured during the handlers chain
> invocation
> 220362 [http-8080-1] INFO
> org.apache.wink.server.internal.handlers.PopulateResponseMediaTypeHandler -
> Content-Type not specified via Response object or via @Produces annotation so
> automatically setting via generic-type compatible MessageBodyWriter providers
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.