EntityBean:
     name ->Products
     JNDI->ejb/Products
发布时都为LocalSessionBean:
(其中的一个方法):
  public String getProductName(Integer id) {
    /**@todo Complete this method*/
    String productName = "name not found";
    try {
      javax.naming.Context context = new javax.naming.InitialContext();
      Object object = context.lookup("java:comp/env/ejb/Products");
      ProductsHome productsHome = (ProductsHome)
          javax.rmi.PortableRemoteObject.narrow(object, ProductsHome.class);
      Products products = productsHome.findByPrimaryKey(id);
      productName = products.getProductName();
    }
    catch (javax.naming.NamingException ex) {
      ex.printStackTrace();
    }
    catch (ClassCastException ex) {
      ex.printStackTrace();
    }
    catch (Exception ex) {
      ex.printStackTrace();
    }
    return productName;
  }