【发布时间】:2014-02-17 17:23:22
【问题描述】:
我试过这段代码
@GET
@Produces("application/xml")
public Customer getMsg() {
Customer cus = em.find(Customer.class,1);
return cus;
}
客户类与地址实体有一对多的关系。 但是当我试图从我的 ajax 客户端调用 ws 时,它会给我这个错误吗?如何解决这个问题。 应用程序在 jboss-eap-6.2 上运行,并且该类是无状态 bean。
JBWEB000065: HTTP Status 500 - org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.test.Customer.addresslist, could not initialize proxy - no Session
【问题讨论】: