我新的web服务,我想知道我做错了什么是我的代码,让我所有的listCustomers与NetBeans测试web服务
@Path("/allCustomers")
@GET
@Produces("application/xml")
public List<Customer> listAllCustomers(){
return customerDao.listAllCustomers();
}
为了测试我的服务我使用NetBeans工具(测试RESTful Web服务),我得到这个错误
Avertissement: StandardWrapperValve[ServletAdaptor]: PWC1406: Servlet.service() for servlet ServletAdaptor threw exception
java.lang.NullPointerException
at com.supinfo.supinbank.service.CustomerService.listAllCustomers(CustomerService.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
PS:我不知道这是否是强制性的注释客户实体XmlRootElement将,但我做到了......
你能不能张贴线40到您的CustomerService类的50? –
40-50行是之前的帖子。 – 113408