Olá…
Estou enfrentando um problema com o Jasper… Acredito que seja uma bobagem, mas como não encontrei referências sobre o erro no google, achei que seria uma boa postar aqui.
Minha classe:
[code]import java.sql.ResultSet;
import java.util.HashMap;
import java.util.Map;
import net.sf.jasperreports.engine.JRResultSetDataSource;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperRunManager;
import net.sf.jasperreports.view.JasperViewer;
/*
- ImprimeRelatorio.java
- Created on 15 de Outubro de 2007, 13:16
- To change this template, choose Tools | Template Manager
- and open the template in the editor.
*/
/**
*
-
@author sigma3
*/
public class ImprimeRelatorio {/** Creates a new instance of ImprimeRelatorio */
public ImprimeRelatorio() {
}public void geraRelatorio() throws Exception{
Conexao conn = new Conexao();
ResultSet rs;
try{
rs = conn.relatorioCapitulo();
/* implementação da interface JRDataSource para DataSource ResultSet */
JRResultSetDataSource jrRS = new JRResultSetDataSource(rs);/* HashMap de parametros utilizados no relatório. Sempre instanciados */ Map parameters = new HashMap(); // parameters.put("COLUNA", valor); /* Preenche o relatório com os dados. Gera o arquivo BibliotecaPessoal.jrprint */ JasperFillManager.fillReportToFile("C:/Projetos/NetBeans/Sistema de FSO/build/web/Teste_de_Relatorio.jasper", parameters, jrRS); /* Exporta para o formato PDF */ JasperExportManager.exportReportToPdfFile("C:/Projetos/NetBeans/build/web/Teste_de_Relatorio.jasper.jrprint"); /* Preenche o relatorio e o salva diretamente em arquivo PDF. Sem a necessidade do .jrprint */ //JasperRunManager.runReportToPdfFile("C:/Projetos/NetBeans/build/web/Teste_de_Relatorio.jasper", parameters, jrRS); /* Visualiza o relatório em formato PDF */ JasperViewer.viewReport("C:/Projetos/NetBeans/build/web/Teste_de_Relatorio.pdf", false ); }catch(Exception erro){ System.out.println("gerRelatorio() ----> " + erro); }
}
}[/code]
Daí quando eu clico no botão que instancia este objeto, e deveria executar este método, ocorre o seguinte erro:
[quote][#|2007-10-16T09:42:02.609-0300|SEVERE|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.application|_ThreadID=13;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=2aa9eddc-e423-49e6-999a-b11a788aff09;|java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.fill.JRVerticalFiller
javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.fill.JRVerticalFiller
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:160)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:240)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:361)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.fill.JRVerticalFiller
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:147)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:83)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601)
at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:492)
at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:448)
at fso.ImprimeRelatorio.geraRelatorio(ImprimeRelatorio.java:43)
at fso.Testes.button1_action(Testes.java:207)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
… 42 more
|#][/quote]
Daí se alguém souber o que pode ser, fico agradecido.
Valeu galera.
:lol: