cezar_apulchro Posted December 20, 2018 Share Posted December 20, 2018 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:jasperreport-6.7.0.jarjasperreport-fonts-6.7.0.jarjasperreport-javaflow-6.7.0.jarthis 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.classmate-0.8.0.jarcommons-annotations-1.0.0.jarcommons-beanutils-1.9.2.jarcommons-collections-20040616.jarcommons-collections-3.2.1.jarcommons-dbcp-1.2.2.jarcommons-fileuplod-1.3.jarcommons-io-2.4.jarcommons-logging-1.2.1.1.jarcommons-math-1.0.jarcommons-pool-1.6.jarcommons-digester3-3.2.jarThe 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 { try { JasperReport jasper = JasperCompileManager.compileReport(reportLoc); JasperPrint printR = JasperFillManager.fillReport(jasper, parametros, new JREmptyDataSource()); JRExporter exporter = new JRPdfExporter(); JasperExportManager.exportReportToPdfStream(printR, saida); exporter.exportReport(); } 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(); if("LstEletro".equals(botaoacao)) { try { 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) { e.printStackTrace(); } } 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 More sharing options...
hozawa Posted December 20, 2018 Share Posted December 20, 2018 You need to version down the commons-digester3-3.2.jar to 2.1 Link to comment Share on other sites More sharing options...
cezar_apulchro Posted December 21, 2018 Author Share Posted December 21, 2018 Hi hozawa, thank you for your assistance. After change the version of jar I'm getting a new error that is: "java.lang.NoClassDefFoundError: org/springframework/beans/factory/support/BeanDefinitionRegistry" Link to comment Share on other sites More sharing options...
hozawa Posted December 22, 2018 Share Posted December 22, 2018 JasperReports doesn't require Springframe so it's probably your program. Seems to be missing pring-beans artifact. Link to comment Share on other sites More sharing options...
cezar_apulchro Posted December 24, 2018 Author Share Posted December 24, 2018 After removing org.springframework.beans-3.1.2.release and spring-core-1.0.2 I'm gettingjava.lang.ClassNotFoundException: org.springframework.beans.factory.support.BeanDefinitionRegistryIn 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 More sharing options...
cezar_apulchro Posted December 25, 2018 Author Share Posted December 25, 2018 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 More sharing options...
cezar_apulchro Posted January 7, 2019 Author Share Posted January 7, 2019 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now