你的这个程序肯定没有问题,我试了,绝对Serializable,所以问题不是出在这,找找别的吧。
解决方案 »
- struts2 spring3.2 hibernate4.1.9 整合No Session found for current thread
- 运行的项目的时候,在WEB.XML里设置收次运行的是Struts里一个Action,但是为什么出404的错误呢
- 有道购物搜索开放数据接口是怎么设计的?
- 初学 hibernate 主键设置问题
- spring
- spring的定时任务如何自动增加任务?
- spring+hibernate1对1关联中ClassCastException
- 把html控件的路径添加到Strus标签文本区呢 急!!!!!!!!!
- TOMCAT:Cannot get a connection, pool exhausted
- 两个独立得问题,请进来回答!!!给分
- jb中建ejb为什么要先弄个EJB module
- 请问sharetop(燕赤霞)一个wsdk的问题
public Zycard_type getZycard_type(Integer card_type_id) throws Exception, RemoteException;session bean调用实体bean中的方法:
public Zycard_type getZycard_type (Integer card_type_id) {
try{
Context ctx = new InitialContext();
Object obj = ctx.lookup("ZycardType");
ZycardTypeHome zycardTypeHome = (ZycardTypeHome)PortableRemoteObject.narrow(obj, ZycardTypeHome.class);
ZycardType zycardType=zycardTypeHome.findByPrimaryKey(card_type_id);
return new Zycard_type(zycardType.getCardTypeId(),zycardType.getDescrip());
}catch (Exception ex) {
throw new EJBException(ex);
}
}客户端调用:
public static void main(String[] args) {
ZycardtypeinsertTestClient2 client = new ZycardtypeinsertTestClient2();
Zycardtypeinsert bean = client.create();
try {
String descrip=bean.getZycard_type(new Integer(12345678)).getdescrip();
System.out.println(descrip);
}catch(Exception e)
{e.printStackTrace();};