jtsai Posted June 4, 2012 Share Posted June 4, 2012 Hi experts,I am new at iReport develop., and I wrote a sample jsp for iReport in Windows+tomcat+iReport environment, the report shows fine.But when I put the same report at Ubuntu linux server with tomcat+iReport , I get error all the time.Can any one knows why? pleas advise., how to fix it?/**************** get error message *********************/HTTP Status 500 -type Exception reportmessagedescription The server encountered an internal error () that prevented it from fulfilling this request.exceptionorg.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 1 in the generated java fileThe type net.sf.jasperreports.engine.JasperReport cannot be resolved. It is indirectly referenced from required .class filesAn error occurred at line: 1 in the generated java fileThe type net.sf.jasperreports.engine.JasperPrint cannot be resolved. It is indirectly referenced from required .class filesAn error occurred at line: 21 in the jsp file: /CustomerInvoicesReport.jspJasperReport cannot be resolved to a type18: JasperReportsWrapper wrapper = new JasperReportsWrapper();19: wrapper.connect2DB(wrapper.dbServerAdd, wrapper.dbServerPort,20: wrapper.dbName, wrapper.dbUser, wrapper.dbPass);21: JasperReport jasperReport =22: wrapper.compileJRXMLFile(path2JRXMLFile);23: JasperPrint jasperPrint =24: wrapper.fillReport(jasperReport,Code:my code <CustomerInvoicesReport.jsp >=========><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF8"><title> JasperReports Web SAMPLE</title></head><body><%@ page language="java" session="false" %><%@ page import="net.sf.jasperreports.engine.*" %><%@ page import="net.sf.jasperreports.engine.export.*" %><%@ page import="com.JasperReportsWrapper" %><%try{String path2JRXMLFile =getServletContext().getRealPath("MonthlyCustomerInvoices.jrxml");// Connect to DBJasperReportsWrapper wrapper = new JasperReportsWrapper();wrapper.connect2DB(wrapper.dbServerAdd, wrapper.dbServerPort,wrapper.dbName, wrapper.dbUser, wrapper.dbPass);JasperReport jasperReport =wrapper.compileJRXMLFile(path2JRXMLFile);JasperPrint jasperPrint = wrapper.fillReport(jasperReport,null, wrapper.getConnection()); // Set response content typeresponse.setContentType("application/pdf");// Create and export PDF to browser windowJRPdfExporter exporter = new JRPdfExporter();exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);exporter.setParameter(JRExporterParameter.OUTPUT_STREAM,response.getOutputStream());exporter.exportReport();}catch (Exception e){ e.printStackTrace();}%></body></html> Link to comment Share on other sites More sharing options...
jtsai Posted June 11, 2012 Author Share Posted June 11, 2012 I fond that it just need to put the required jar files into physical WEB-INF/lib directory.You can not use symbolic link instead. after I do this: rm myAps/WEB-INF/lib # remove my symbolic linkmkdir myAps/WEB-INF/libcp ../myJarLib/*.jar myAps/WEB-INF/lib/ restart tomcat It works fine now. Thanks 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