You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eu creei um relatório personalizado jasper, e na hora de gerar o pdf, dá um erro e o pdf gerado não é possível ser aberto.
Segue o erro:
2022-08-29 17:15:11.142 ERROR 11484 --- [nio-5072-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is br.com.caelum.stella.boleto.exception.GeracaoBoletoException: br.com.caelum.stella.boleto.exception.GeracaoBoletoException: net.sf.jasperreports.engine.JRException: Class not found when loading object from InputStream] with root cause
java.lang.ClassNotFoundException: net.sf.jasperreports.compilers.ReportExpressionEvaluationData
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_251]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_251]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_251]
//Mapa para parâmetros
Map<String, Object> parametros = new HashMap<String, Object>();
parametros.put("NR_CFD", "TESTE");
String reportPath = "C:\\boleto-layout.jasper";
//carrega o conteúdo do arquivo em um InputStream
InputStream templateBoleto = new FileInputStream(reportPath);
GeradorDeBoleto gerador = new GeradorDeBoleto(templateBoleto,parametros,boleto);
System.out.println(gerador.toString());
File pdf = new File("C:\\pasta-boleto\\BancoCisne.pdf");
gerador.geraPDF(pdf);
The text was updated successfully, but these errors were encountered:
Eu creei um relatório personalizado jasper, e na hora de gerar o pdf, dá um erro e o pdf gerado não é possível ser aberto.
Segue o erro:
2022-08-29 17:15:11.142 ERROR 11484 --- [nio-5072-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is br.com.caelum.stella.boleto.exception.GeracaoBoletoException: br.com.caelum.stella.boleto.exception.GeracaoBoletoException: net.sf.jasperreports.engine.JRException: Class not found when loading object from InputStream] with root cause
java.lang.ClassNotFoundException: net.sf.jasperreports.compilers.ReportExpressionEvaluationData
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_251]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_251]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_251]
O código:
Boleto boleto = montarEstruturaBoleto(idCliente, numeroFatura);
The text was updated successfully, but these errors were encountered: