You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by "Bryant Luk (JIRA)" <ji...@apache.org> on 2010/01/28 05:11:34 UTC
[jira] Resolved: (WINK-246) Problem(?) with JAXB based sub resource
[ https://issues.apache.org/jira/browse/WINK-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryant Luk resolved WINK-246.
-----------------------------
Resolution: Invalid
Dims, I'll mark this invalid unless you believe we should do something differently or my interpretation is wrong. For this issue, I do not believe we should go against the spec because it can lead to unpredictable situations. For instance, some users could re-use the same class in a sub resource locator and also in a subresource method and could be counting on the JAX-RS spec behavior.
> 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
> Assignee: Bryant Luk
>
> 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.