2013-05-20 2 views
0

У меня есть этот ресурсОСТАЛЬНЫЕ Джерси исключение AbstractJAXBProvider

@Path("customer") 
public class Customers 

внутри него, у меня есть эта функция:

@Path("signin/{mobileNumber}/{simNumber}/{password}") 
    @GET 
    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) 
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED) 
    public CustomerImpl signgin(@PathParam("mobileNumber") String mobileNumber, 
      @PathParam("simNumber") String simNumber, 
      @PathParam("password") String password) { 
     // return "dddddddddddddddddddddddddddddddd"; 
     return CustomerWraper.instance.getOne(1); 
    } 

, когда я называю эту функцию я получил исключение,

Я использую customerWraper :

public enum CustomerWraper { 
    instance; 
    private Map<Integer, CustomerImpl> customers = new HashMap<Integer, CustomerImpl>(); 

    public Map<Integer, CustomerImpl> getData() { 
     return customers; 
    } 

    private CustomerWraper() { 
     CustomerImpl c = (CustomerImpl)CustomerImpl.getCustomer(1); 
     this.customers.put(1, c); 
    } 

    public CustomerImpl getOne(int ID) { 
     CustomerImpl customer = getData().get(ID); 
     if (customer == null) { 
      //customer = (CustomerImpl) CustomerImpl.getCustomer(ID); 
      customer = new CustomerImpl("0999440921", "123", "123"); 
     } 
     return customer; 
    } 
} 

ПРИМЕЧАНИЕ:

Класс customerImpl как это:

@XmlRootElement(name = "customer") 
public class CustomerImpl extends com.syriatel.eattel.user.User implements 
     Customer { 

Пользователь класс является абстрактным.

Исключение составляет: (Это долго, смотрите в конце этого)

May 20, 2013 1:49:12 AM com.sun.jersey.spi.container.ContainerResponse logException 
SEVERE: Mapped exception to response: 500 (Internal Server Error) 
javax.ws.rs.WebApplicationException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 23 counts of IllegalAnnotationExceptions 
com.syriatel.eattel.user.Customer is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.Customer 
     at public com.syriatel.eattel.user.Customer com.syriatel.eattel.location.CustomerAddressImpl.getCustomer() 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.user.Customer does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.Customer 
     at public com.syriatel.eattel.user.Customer com.syriatel.eattel.location.CustomerAddressImpl.getCustomer() 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.Area is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.Area 
     at public com.syriatel.eattel.location.Area com.syriatel.eattel.location.AddressImpl.getArea() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.Area does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.Area 
     at public com.syriatel.eattel.location.Area com.syriatel.eattel.location.AddressImpl.getArea() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.City is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.City 
     at public com.syriatel.eattel.location.City com.syriatel.eattel.location.AddressImpl.getCity() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.City does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.City 
     at public com.syriatel.eattel.location.City com.syriatel.eattel.location.AddressImpl.getCity() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.Region is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.Region 
     at public com.syriatel.eattel.location.Region com.syriatel.eattel.location.AddressImpl.getRegion() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.Region does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.Region 
     at public com.syriatel.eattel.location.Region com.syriatel.eattel.location.AddressImpl.getRegion() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.user.FavoriteFood does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.FavoriteFood 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getFavoriteFoods() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.food.RestaurantFood is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.food.RestaurantFood 
     at public com.syriatel.eattel.food.RestaurantFood com.syriatel.eattel.user.FavoriteFood.getFood() 
     at com.syriatel.eattel.user.FavoriteFood 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getFavoriteFoods() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.food.RestaurantFood does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.food.RestaurantFood 
     at public com.syriatel.eattel.food.RestaurantFood com.syriatel.eattel.user.FavoriteFood.getFood() 
     at com.syriatel.eattel.user.FavoriteFood 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getFavoriteFoods() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.user.FavoriteRestaurant does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.FavoriteRestaurant 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getFavoriteRestaurants() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.OrderImpl does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.CustomerAddress is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.CustomerAddress 
     at public com.syriatel.eattel.location.CustomerAddress com.syriatel.eattel.order.OrderImpl.getAddress() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.CustomerAddress does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.CustomerAddress 
     at public com.syriatel.eattel.location.CustomerAddress com.syriatel.eattel.order.OrderImpl.getAddress() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.FoodOrder is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.FoodOrder 
     at public java.util.List com.syriatel.eattel.order.OrderImpl.getFoods() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.FoodOrder does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.FoodOrder 
     at public java.util.List com.syriatel.eattel.order.OrderImpl.getFoods() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.user.Restaurant is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.Restaurant 
     at public com.syriatel.eattel.user.Restaurant com.syriatel.eattel.order.OrderImpl.getRestaurant() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.user.Restaurant does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.Restaurant 
     at public com.syriatel.eattel.user.Restaurant com.syriatel.eattel.order.OrderImpl.getRestaurant() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.OrderStatus does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.OrderStatus 
     at public com.syriatel.eattel.order.OrderStatus com.syriatel.eattel.order.OrderImpl.getStatus() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
java.sql.Timestamp does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at java.sql.Timestamp 
     at public java.sql.Timestamp com.syriatel.eattel.order.OrderStatus.getEndDate() 
     at com.syriatel.eattel.order.OrderStatus 
     at public com.syriatel.eattel.order.OrderStatus com.syriatel.eattel.order.OrderImpl.getStatus() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.Order is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.Order 
     at public com.syriatel.eattel.order.Order com.syriatel.eattel.order.OrderStatus.getOrder() 
     at com.syriatel.eattel.order.OrderStatus 
     at public com.syriatel.eattel.order.OrderStatus com.syriatel.eattel.order.OrderImpl.getStatus() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.Order does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.Order 
     at public com.syriatel.eattel.order.Order com.syriatel.eattel.order.OrderStatus.getOrder() 
     at com.syriatel.eattel.order.OrderStatus 
     at public com.syriatel.eattel.order.OrderStatus com.syriatel.eattel.order.OrderImpl.getStatus() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 

    at com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.writeTo(AbstractRootElementProvider.java:159) 
    at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306) 
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1479) 
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) 
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) 
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) 
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) 
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395) 
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250) 
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) 
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166) 
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
    at java.lang.Thread.run(Unknown Source) 
Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 23 counts of IllegalAnnotationExceptions 
com.syriatel.eattel.user.Customer is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.Customer 
     at public com.syriatel.eattel.user.Customer com.syriatel.eattel.location.CustomerAddressImpl.getCustomer() 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.user.Customer does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.Customer 
     at public com.syriatel.eattel.user.Customer com.syriatel.eattel.location.CustomerAddressImpl.getCustomer() 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.Area is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.Area 
     at public com.syriatel.eattel.location.Area com.syriatel.eattel.location.AddressImpl.getArea() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.Area does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.Area 
     at public com.syriatel.eattel.location.Area com.syriatel.eattel.location.AddressImpl.getArea() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.City is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.City 
     at public com.syriatel.eattel.location.City com.syriatel.eattel.location.AddressImpl.getCity() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.City does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.City 
     at public com.syriatel.eattel.location.City com.syriatel.eattel.location.AddressImpl.getCity() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.Region is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.Region 
     at public com.syriatel.eattel.location.Region com.syriatel.eattel.location.AddressImpl.getRegion() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.Region does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.Region 
     at public com.syriatel.eattel.location.Region com.syriatel.eattel.location.AddressImpl.getRegion() 
     at com.syriatel.eattel.location.AddressImpl 
     at com.syriatel.eattel.location.CustomerAddressImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getAddresses() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.user.FavoriteFood does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.FavoriteFood 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getFavoriteFoods() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.food.RestaurantFood is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.food.RestaurantFood 
     at public com.syriatel.eattel.food.RestaurantFood com.syriatel.eattel.user.FavoriteFood.getFood() 
     at com.syriatel.eattel.user.FavoriteFood 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getFavoriteFoods() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.food.RestaurantFood does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.food.RestaurantFood 
     at public com.syriatel.eattel.food.RestaurantFood com.syriatel.eattel.user.FavoriteFood.getFood() 
     at com.syriatel.eattel.user.FavoriteFood 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getFavoriteFoods() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.user.FavoriteRestaurant does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.FavoriteRestaurant 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getFavoriteRestaurants() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.OrderImpl does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.CustomerAddress is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.CustomerAddress 
     at public com.syriatel.eattel.location.CustomerAddress com.syriatel.eattel.order.OrderImpl.getAddress() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.location.CustomerAddress does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.location.CustomerAddress 
     at public com.syriatel.eattel.location.CustomerAddress com.syriatel.eattel.order.OrderImpl.getAddress() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.FoodOrder is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.FoodOrder 
     at public java.util.List com.syriatel.eattel.order.OrderImpl.getFoods() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.FoodOrder does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.FoodOrder 
     at public java.util.List com.syriatel.eattel.order.OrderImpl.getFoods() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.user.Restaurant is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.Restaurant 
     at public com.syriatel.eattel.user.Restaurant com.syriatel.eattel.order.OrderImpl.getRestaurant() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.user.Restaurant does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.user.Restaurant 
     at public com.syriatel.eattel.user.Restaurant com.syriatel.eattel.order.OrderImpl.getRestaurant() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.OrderStatus does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.OrderStatus 
     at public com.syriatel.eattel.order.OrderStatus com.syriatel.eattel.order.OrderImpl.getStatus() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
java.sql.Timestamp does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at java.sql.Timestamp 
     at public java.sql.Timestamp com.syriatel.eattel.order.OrderStatus.getEndDate() 
     at com.syriatel.eattel.order.OrderStatus 
     at public com.syriatel.eattel.order.OrderStatus com.syriatel.eattel.order.OrderImpl.getStatus() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.Order is an interface, and JAXB can't handle interfaces. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.Order 
     at public com.syriatel.eattel.order.Order com.syriatel.eattel.order.OrderStatus.getOrder() 
     at com.syriatel.eattel.order.OrderStatus 
     at public com.syriatel.eattel.order.OrderStatus com.syriatel.eattel.order.OrderImpl.getStatus() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 
com.syriatel.eattel.order.Order does not have a no-arg default constructor. 
    this problem is related to the following location: 
     at com.syriatel.eattel.order.Order 
     at public com.syriatel.eattel.order.Order com.syriatel.eattel.order.OrderStatus.getOrder() 
     at com.syriatel.eattel.order.OrderStatus 
     at public com.syriatel.eattel.order.OrderStatus com.syriatel.eattel.order.OrderImpl.getStatus() 
     at com.syriatel.eattel.order.OrderImpl 
     at public java.util.List com.syriatel.eattel.user.CustomerImpl.getOrders() 
     at com.syriatel.eattel.user.CustomerImpl 

    at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source) 
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source) 
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source) 
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source) 
    at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source) 
    at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at javax.xml.bind.ContextFinder.newInstance(Unknown Source) 
    at javax.xml.bind.ContextFinder.find(Unknown Source) 
    at javax.xml.bind.JAXBContext.newInstance(Unknown Source) 
    at javax.xml.bind.JAXBContext.newInstance(Unknown Source) 
    at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.getStoredJAXBContext(AbstractJAXBProvider.java:194) 
    at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.getJAXBContext(AbstractJAXBProvider.java:187) 
    at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.getMarshaller(AbstractJAXBProvider.java:165) 
    at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.getMarshaller(AbstractJAXBProvider.java:144) 
    at com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.writeTo(AbstractRootElementProvider.java:151) 
    ... 25 more 
+0

help please ........... –

ответ

1

Вот интересная линия для вас из вашей трассировки стека;

com.syriatel.eattel.user.Customer is an interface, and JAXB can't handle interfaces. 

Ваша трассировка стека ясно показывает намного больше классов по сравнению с тем, что вы опубликовали. Проверьте свой код еще раз. Где-то интерфейс «Клиент» ссылается напрямую или ссылается таким образом, что Джерси пытается инициировать его напрямую.

Я бы посоветовал избавиться от интерфейса в целом, если можно, только сейчас, только чтобы убедиться, что это настоящий преступник.

+0

Я удалил все классы, кроме клиента, customerImpl, пользователь, теперь у меня есть это исключение. Писатель тела сообщения для класса Java com.syriatel.eattel.user. CustomerImpl и интерфейс типа Java com.syriatel.eattel.user.Customer и MIME тип текста text/html не был найден' –

+0

У вас все еще есть что-то, ссылающееся на интерфейс Customer где-то. Это нелегко найти. Сообщение для CustomerImpl запутывает меня. это происходит, когда у вас нет сопоставлений xml в классе реализации, но я вижу, что у вас это есть на CustomerImpl @XmlRootElement (name = "customer"). Возможно, тот факт, что CustomerImpl реализует Клиент, имеет к этому какое-то отношение. Также ИМХО перезапускает действительно помощь, хотя я до сих пор не знаю, как :) – Raza

+0

Я понятия не имею, почему вы получаете это. 'MIME media type text/html не был найден' – Raza

Смежные вопросы