j2ee toplink

来源:百度知道 编辑:UC知道 时间:2024/06/13 16:35:54
javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: null; nested exception is:
java.lang.NoSuchMethodError: com.yaps.petstore.entity.customer.Customer._toplink_gettest_homeAddress()Lcom/yaps/petstore/entity/Address;
at com.yaps.petstore.stateless.customer._CustomerRemote_Wrapper.findCustomer(com/yaps/petstore/stateless/customer/_CustomerRemote_Wrapper.java)
at com.yaps.petstore.client.delegate.CustomerDelegate.findCustomer(CustomerDelegate.java:27)
at com.yaps.petstore.client.ui.customer.model.CustomerTableModel.crudFrameFactory(CustomerTableModel.java:81)
at com.yaps.petstore.client.ui.util.YapsListFrame.showFrame(YapsListFrame.java:141)
at com.yaps.petstore.client.ui.util.YapsListFrame.updateActionPerformed(YapsListFrame.java:121)
at com.yaps.petstore.client.ui.util.YapsActionPane.fireActionPerformed(YapsActionPane.java:199)

哎,用框架任何一个地方出错就会抛大堆异常,不看你的整个项目,就光看这异常也不好确定

看错误不是你说的那个原因,我认为是你的class版本不统一造成的。

你修改了东西,重新编译,覆盖以前的,就行了。

java.lang.NoSuchMethodError:

这个错误90%是因为版本不同,比如调用方是新版本的class,而被调用的忘记更新了。

如果这个是你自己写的,那就简单了,相信一讲你就会明白,不然可是大麻烦,看下面:
FetchType.EAGER 表示关联关系的从类在主类加载的时候同时加载;
FetchType.LAZY表示关联关系的从类在自己被访问时才加载。
一个是同时,一个是要在被访问时,回头去看一下你的程序的要求就会明白了吧。

其实你清理后再生成主项目就可以了,不停的生成是不行的,出现这种问题的时候,需要清理并生成主项目。