throw new EJBException("Cannot lookup User: " +e);
throw new RemoteException("Cannot lookup User: " +e);
  public int authenticate (String name, String password)  {    int userId = -1;    // Connecting to user Home interface thru JNDI    UserHome userHome = null;    try     {      userHome = (UserHome)PortableRemoteObject.narrow(initialContext.lookup("java:comp/env/ejb/User"), UserHome.class);    }     catch (Exception e)    {      throw new EJBException("Cannot lookup User: " +e);    }    // get the User ID    try    {      User user = userHome.findByNickName(name);      String pwd = user.getPassword();      if (pwd.compareTo(password) == 0)      {        userId = user.getId().intValue();      }    }    catch (Exception e)    {      throw new EJBException(" User "+name+" does not exist in the database!<br>(got exception: " +e);    }    return userId;  }