Jump to content

java.lang.ClassNotFoundException: org.apache.commons.digester.Digester


Recommended Posts

I saw in the internet forums that this problem is some libs out off classpath then I have set up the classpath, below is my libs:




this first 3 libs was downloaded from jaspersoft site, "jasperreport library", the next libs was downloaded by search in the internet forums because the ocurred errors.













The last lib was downloaded by http://commons.apache.org/proper/commons-digester/download_digester.cgi how JasperReports Ultimate Guide say, but my problem still the same.

Who can help me.

Thanks in advance.

Cezar Apulchro.

My class:

public class GeradorDeRelatorios
    public void geraPDF(String reportLoc,
                        Map parametros,
                        OutputStream saida) throws JRException
            JasperReport jasper = JasperCompileManager.compileReport(reportLoc);
            JasperPrint printR = JasperFillManager.fillReport(jasper, parametros, new JREmptyDataSource());
            JRExporter exporter = new JRPdfExporter();
            JasperExportManager.exportReportToPdfStream(printR, saida);
        } catch(JRException e)
            throw new RuntimeException("Erro ao gerar relatório", e);

My servlet:

protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
        botaoacao = request.getParameter("acaobotao");
        Map parametros = new HashMap();
                PacientesDAO_W01 pcdao = new PacientesDAO_W01();
                DadosPaciente dpaciente = new DadosPaciente();
                dpaciente = pcdao.lstEletroDia();
                sendNome = dpaciente.getNome();
                sendSexo = dpaciente.getSexo();
                sendDNascimento = dpaciente.getData_Nascimento();
                sendTelefone = dpaciente.getTelefone_Residencial();
                System.out.println("Nome: " + sendNome);
                parametros.put("Nome", sendNome);
                parametros.put("Sexo", sendSexo);
                parametros.put("data_Nascimento", sendDNascimento);
                parametros.put("telefone_Residencial", sendTelefone);
            catch (Exception e)
        ServletContext context = getServletContext();
        String reportLoc = "/ITCWEB/ListAgenda_Eletro_W001.jrxml";
        GeradorDeRelatorios geraPDF = new GeradorDeRelatorios();
        try {
            geraPDF.geraPDF(reportLoc, parametros, response.getOutputStream());
        } catch (JRException ex) {
            Logger.getLogger(ListAgenda_Eletro_S002.class.getName()).log(Level.SEVERE, null, ex);

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

After removing org.springframework.beans-3.1.2.release and spring-core-1.0.2 I'm getting

java.lang.ClassNotFoundException: org.springframework.beans.factory.support.BeanDefinitionRegistry

In my jasperreport I have defined the fields Nome, Sexo, data_Nascimento,  telefone_Residencial and these fields are defined in "Dataset and Query Dialog" too. My report is very simple, these fields, title and one field of parameter to receive date.

Link to comment
Share on other sites

Your last contact you say, seems to be missing pring-beans artifact. I believe that is my problem. when I have created desktop reports using ireports I have defined the path of my bean class. in jaspersoft studio I can't define the path of my bean class. I'm defining the fields by 'add' and 'edit' button in 'java bean' of Dataset and Query Dialog screen. Is right? 

Link to comment
Share on other sites

  • 2 weeks later...

Hi, I have created a new report in JasperSoft Studio, now I have defined mysql db as source data. When I press preview button, all my fields defined in my sql "SELECT" are show in the manner  that I need. But the error now is: "

java.lang.ClassCastException: cannot assign instance of net.sf.jasperreports.engine.base.JRBaseStaticText to field net.sf.jasperreports.engine.base.JRBaseParagraph.paragraphContainer of type net.sf.jasperreports.engine.JRParagraphContainer in instance of net.sf.jasperreports.engine.base.JRBaseParagraph"

I can't understend what happen, I'm totally lost.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...