aggelos Posted October 26, 2006 Share Posted October 26, 2006 Hi All,i'm trying to export a report to xml and html in a web app, when i compile and execute my app in a tomcat 5.5 version and a oracle client 10g version instaled in my pc it's working ok but when i upload into a server whit a tomcat 5.0 version and the local oracle databese instaled, this error is produced when i tray to export a report to html and xls:2006-10-26 10:22:26 StandardWrapperValve[reporte_excel]: Servlet.service() for servlet reporte_excel threw exceptionjava.lang.NoClassDefFoundError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:140) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62) at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:58) at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:311) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:92) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:74) at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:147) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:57) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:234) at interfaz.Reporte_Excel.doGet(Reporte_Excel.java:92) at interfaz.Reporte_Excel.doPost(Reporte_Excel.java:170) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:234) at interfaz.Reporte_Excel.doGet(Reporte_Excel.java:92) at interfaz.Reporte_Excel.doPost(Reporte_Excel.java:170) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)icationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv this is my code: String cpu = "Reporte_Excel.jasper"; // Reporteador de PC's String red = "Reporte_Red.jasper"; // Reporteador Equipos RED String ups = "Reporte_UPS.jasper"; // Reporteador de UPS's String pt = "Reporte_PT.jasper"; // Reporteador Plantas Tel. String base = "Reporte_Base.jasper"; // Reporteador Base Cargador String cargador = "Reporte_Cargador.jasper"; // Reporteador de Cargador String bateria = "Reporte_Bateria.jasper"; // Reporteador de Baterias String usr = (String) request.getSession(false).getAttribute( "usr"); String pass = (String) request.getSession(false).getAttribute( "pwd"); ruta = (String) request.getParameter("ruta") + "/"; try { Connection con = Persistencia.getInstance().demeConexion(usr, pass); Map parameters = new HashMap(); //Parámetros del Reporte parameters.put("SUBREPORT_DIR", ruta); /* Insertar los Datos en los reportes -----NEXT LINE IS LINE 92 ------*/ JasperPrint jp_CPU = JasperFillManager.fillReport(ruta + cpu, parameters, con); JasperPrint jp_RED = JasperFillManager.fillReport(ruta + red, parameters, con); JasperPrint jp_UPS = JasperFillManager.fillReport(ruta + ups, parameters, con); JasperPrint jp_PT = JasperFillManager.fillReport(ruta + pt, parameters, con); JasperPrint jp_BASE = JasperFillManager.fillReport(ruta + base, parameters, con); JasperPrint jp_CARGADOR = JasperFillManager.fillReport(ruta + cargador, parameters, con); JasperPrint jp_BATERIA = JasperFillManager.fillReport(ruta + bateria, parameters, con); File destFile = new File(ruta, "Listado de Equipos.xls"); JRXlsExporter exporter = new JRXlsExporter(); /* Insertar las paginas de los reportes en un solo archivo xls */ int i = 1; if (jp_RED.getPages().size() > 0) { jp_CPU.addPage(i, jp_RED.removePage(0)); i = i + 1; } if (jp_UPS.getPages().size() > 0) { jp_CPU.addPage(i, jp_UPS.removePage(0)); i = i + 1; } if (jp_PT.getPages().size() > 0) { jp_CPU.addPage(i, jp_PT.removePage(0)); i = i + 1; } if (jp_BASE.getPages().size() > 0) { jp_CPU.addPage(i, jp_BASE.removePage(0)); i = i + 1; } if (jp_CARGADOR.getPages().size() > 0) { jp_CPU.addPage(i, jp_CARGADOR.removePage(0)); i = i + 1; } if (jp_BATERIA.getPages().size() > 0) { jp_CPU.addPage(i, jp_BATERIA.removePage(0)); i = i + 1; } exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp_CPU); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString()); exporter.setParameter(JRXlsExporterParameter. IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); exporter.exportReport(); please...i really need help.... THANKS A LOT Viviana Link to comment Share on other sites More sharing options...
rsilverns.sympatico.ca Posted October 27, 2006 Share Posted October 27, 2006 This sounds a lot like the post concerning the headless exception. Try running your tomcat with -Djava.awt.headless=true flag set and see what happens. Link to comment Share on other sites More sharing options...
nickchang Posted October 27, 2006 Share Posted October 27, 2006 Hi: i met the same situation as you said. And my web server is WebSphere 6.0. how can i do? set the websphere boot parameter with " handless=true"? please help me! thanks Link to comment Share on other sites More sharing options...
rsilverns.sympatico.ca Posted October 27, 2006 Share Posted October 27, 2006 It's a java system option. I use Geronimo/Tomcat, so not sure about websphere, but in Geronimo/Tomcat I have to find the script that starts the server running and add the option -Djava.awt.headless=true to that script as part of the command options... JAVA_OPTS="$JAVA_OPTS "-Djava.awt.headless=true" HTH,Robin Link to comment Share on other sites More sharing options...
aggelos Posted November 15, 2006 Author Share Posted November 15, 2006 hi rsilver@bfm.bm, it works ok...THANKS a lot, BYE 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