私はWebサービスを初めて使用し、何が間違っているのか知りたいのですが、これがすべてのlistCustomersを取得するためのコードです。
@Path("/allCustomers")
@GET
@Produces("application/xml")
public List<Customer> listAllCustomers(){
return customerDao.listAllCustomers();
}
サービスをテストするには、netbeansツール(TEST 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で顧客エンティティに注釈を付けることが必須かどうかはわかりませんが、私はそれを行いました...