error("Error adding hard token: ",e);
    public void addHardToken(Admin admin, String tokensn, String username, int tokentype,        HardToken hardtokendata, Collection certificates)        throws HardTokenExistsException {        debug(">addHardToken(tokensn : " + tokensn + ")");        try {            hardtokendatahome.create(tokensn, username, new java.util.Date(), new java.util.Date(),                tokentype, hardtokendata);            if (certificates != null) {                Iterator i = certificates.iterator();                while (i.hasNext()) {                    addHardTokenCertificateMapping(admin, tokensn, (X509Certificate) i.next());                }            }            getLogSession().log(admin, LogEntry.MODULE_HARDTOKEN, new java.util.Date(), username,                null, LogEntry.EVENT_INFO_HARDTOKENDATA,                "Hard token with serial number : " + tokensn + " added.");        } catch (Exception e) {            try {                getLogSession().log(admin, LogEntry.MODULE_HARDTOKEN, new java.util.Date(),                    username, null, LogEntry.EVENT_ERROR_HARDTOKENDATA,                    "Trying to add hard tokensn that already exists.");            } catch (RemoteException re) {                throw new EJBException(e);            }            throw new HardTokenExistsException("Tokensn : " + tokensn);        }        debug("<addHardToken()");    }