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.APPLICATION_XML)
    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.

Reply via email to