Jump to content
We've recently updated our Privacy Statement, available here ×

iReport 4.6.0 on Ubuntu server problem


jtsai

Recommended Posts

  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 report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 1 in the generated java file
The type net.sf.jasperreports.engine.JasperReport cannot be resolved. It is indirectly referenced from required .class files

An error occurred at line: 1 in the generated java file
The type net.sf.jasperreports.engine.JasperPrint cannot be resolved. It is indirectly referenced from required .class files

An error occurred at line: 21 in the jsp file: /CustomerInvoicesReport.jsp
JasperReport cannot be resolved to a type
18: 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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

 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 link
mkdir myAps/WEB-INF/lib
cp ../myJarLib/*.jar  myAps/WEB-INF/lib/
 
restart tomcat
 
It works fine now.
 
Thanks
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...