PrintStream ps = new PrintStream(res.getOutputStream()); e.printStackTrace(ps);
    public void doGet(HttpServletRequest req,  HttpServletResponse res) throws java.io.IOException, ServletException {        log.debug(">doGet()");        // Check if authorized        EjbcaWebBean ejbcawebbean= (se.anatom.ejbca.webdist.webconfiguration.EjbcaWebBean)                                   req.getSession().getAttribute("ejbcawebbean");        if ( ejbcawebbean == null ){          try {            ejbcawebbean = (se.anatom.ejbca.webdist.webconfiguration.EjbcaWebBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "se.anatom.ejbca.webdist.webconfiguration.EjbcaWebBean");           } catch (ClassNotFoundException exc) {               throw new ServletException(exc.getMessage());           }catch (Exception exc) {               throw new ServletException (" Cannot create bean of class "+"se.anatom.ejbca.webdist.webconfiguration.EjbcaWebBean", exc);           }           req.getSession().setAttribute("ejbcawebbean", ejbcawebbean);        }        try{          ejbcawebbean.initialize(req, "/ca_functionality/basic_functions");        } catch(Exception e){           throw new java.io.IOException("Authorization Denied");        }        String issuerdn = null;         if(req.getParameter(ISSUER_PROPERTY) != null){          issuerdn = java.net.URLDecoder.decode(req.getParameter(ISSUER_PROPERTY),"UTF-8");        }                String command;        // Keep this for logging.        String remoteAddr = req.getRemoteAddr();        command = req.getParameter(COMMAND_PROPERTY_NAME);        if (command == null)            command = "";        if (command.equalsIgnoreCase(COMMAND_CRL) && issuerdn != null) {            try {                Admin admin = new Admin(((X509Certificate[]) req.getAttribute( "javax.servlet.request.X509Certificate" ))[0]);                ICertificateStoreSessionLocal store = getStoreHome().create();                byte[] crl = store.getLastCRL(admin, issuerdn);                X509CRL x509crl = CertTools.getCRLfromByteArray(crl);                String dn = CertTools.getIssuerDN(x509crl);                String filename = CertTools.getPartFromDN(dn,"CN")+".crl";                if (res.containsHeader("Pragma")) {                    log.debug("Removing Pragma header to avoid caching issues in IE");                    res.setHeader("Pragma",null);                }                if (res.containsHeader("Cache-Control")) {                    log.debug("Removing Cache-Control header to avoid caching issues in IE");                    res.setHeader("Cache-Control",null);                }                res.setHeader("Content-disposition", "attachment; filename=" +  filename);                res.setContentType("application/pkix-crl");                res.setContentLength(crl.length);                res.getOutputStream().write(crl);                log.info("Sent latest CRL to client at " + remoteAddr);            } catch (Exception e) {                log.error("Error sending latest CRL to " + remoteAddr, e);                PrintStream ps = new PrintStream(res.getOutputStream());                e.printStackTrace(ps);                res.sendError(HttpServletResponse.SC_NOT_FOUND, "Error getting latest CRL.");                return;            }        }    } // doGet