j2ee高手进

来源:百度知道 编辑:UC知道 时间:2024/05/25 20:49:12
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)

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

数据源的配置涉及修改server.xml和web.xml,在server.xml中加入定义数据源的元素<Resource>,在web.xml加入<resource-ref>元素,声明该Web应用所引用的数据

A.在server.xml中加入<Resource>元素:<Resource>元素用来定义JNDI Resource。

属性 描述
name 指定Resource的JNDI名字
auth 指定管理Resource的Manager,它有两个可选值:Container、Application
type 指定Resource所属的Java类名

<Resource name = "jdbc/BookDb"
auth = "Container"
type = "javax.sql.DataSource" />

B.在<Resource>元素中加入<ResourceParams>元素:<ResourceParams>元素用来指定各种参数值

属性 描述
factory 指定生成的DataResource的factory类名
maxActive 指定数据库连接池中处于活动状态的最大连接数目,0表示不受限制
maxIdle 指定数据库连接池中处于空闲状态的最大连接数目,0表示不受限制
maxWait 指定连接池中连接处于空闲状态的最长时间,超过会抛出异常,-1表示无限
username 指定连接数据库的用户名
password 指定连接