你的这个程序肯定没有问题,我试了,绝对Serializable,所以问题不是出在这,找找别的吧。

解决方案 »

  1.   

    是不是下面程序有错?但编译通过。session bean 定议的接口:
      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();};