I found this issue today, but I don't understand why? 

2009-8-17 18:05:09 org.apache.cxf.jaxrs.provider.AbstractJAXBProvider
handleJAXBException
Warning: javax.xml.bind.MarshalException
 - with linked exception:
[javax.xml.bind.JAXBException: class com.demo.Apple nor any of its super
class is known to this context.]

Following is my demo code:

@XmlRootElement(name = "apple")
public class Apple {

        private int id = -1;
        private String name;
        private String color;
        private int size;

        set...
        get...
}


@XmlRootElement(name = "response")
public class CRUDResponse<T extends Object> {

        private int total;
        private int limit;
        private int start;
        private boolean success = true;
        private T entity;
        private List<T> entityList;

        set...
        get...
}

        public Response getApple(String id) throws Exception {
                Apple apple = new 
AppleServiceImpl().getApple(Integer.parseInt(id));
                return Response.ok(new CRUDResponse<Apple>(apple)).build();
        }
-- 
View this message in context: 
http://www.nabble.com/Exception-about-%22***-nor-any-of-its-super-class-is-known-to-this-context%22-tp25004234p25004234.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to