?entity bean问题,高手们帮帮忙!!!(烦啊)

jsyx 2002-03-12 10:20:53
我用的是weblogic6.1。
这是ejbhome中的create()
Account create(String accountID, String ownerName) throws CreateException, RemoteException;

这是bean中的
public AccountPK ejbCreate(String accountID, String ownerName) throws CreateException {
PreparedStatement pstmt = null;
Connection conn = null;
try {
System.out.println("ejbCreate() called.");
this.accountID = accountID;
this.ownerName = ownerName;
this.balance = 0;
pstmt = conn.prepareStatement("insert into scott.accounts (accountID, ownerName, balance) values (?, ?, ?)");
pstmt.setString(1, accountID);
pstmt.setString(2, ownerName);
pstmt.setDouble(3, balance);
pstmt.executeUpdate();
return new AccountPK(accountID);
} catch (Exception e) {
throw new CreateException(e.toString());
} finally {
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}
}
我调用的时候总报这个错误,一头雾水,请高手指点!
java.io.InvalidClassException: javax.ejb.EJBException; Local class not compatibl
e: stream classdesc serialVersionUID=-9219910240172116449 local class serialVers
ionUID=796770993296843510
...全文
47 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
superszhu 2002-03-20
  • 打赏
  • 举报
回复
实在不行,就一步一步来,先将程序改为state Session Bean
如能成,再转为entity Bean 试试
jsyx 2002-03-20
  • 打赏
  • 举报
回复
help,在线等待
jsyx 2002-03-20
  • 打赏
  • 举报
回复
大家再给出点注意
jsyx 2002-03-20
  • 打赏
  • 举报
回复
我把所有的class都重新检查了,而且重新编译了,仍是这样。

真想砸电脑
simoncn 2002-03-20
  • 打赏
  • 举报
回复
java.io.InvalidClassException: javax.ejb.EJBException; Local class not compatibl
e: stream classdesc serialVersionUID=-9219910240172116449 local class serialVers
ionUID=796770993296843510
--make sure your compiled AccountPK.class is on your client classpath, and other EJB classes are the latest.
There is nothing related with your code, just bad deployment.
jsyx 2002-03-19
  • 打赏
  • 举报
回复
master ejb 2的例子,应该不会有问题的。
始终是这个错误。真烦
udoo 2002-03-12
  • 打赏
  • 举报
回复
应该是remote和local不一致吧
udoo 2002-03-12
  • 打赏
  • 举报
回复
是不是local 和 home的定义不一致
yanchang 2002-03-12
  • 打赏
  • 举报
回复
不一定对,参考:

应该
return null

另外你只在try内return了
sally0156 2002-03-12
  • 打赏
  • 举报
回复
不对不对,看错了看错了
sally0156 2002-03-12
  • 打赏
  • 举报
回复
AccountPK ejbCreate(String accountID, String ownerName) 是带两个形参,你在下面调用时new AccountPK(accountID);
是不是这个原因

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧