How to deploy Jasper Report in Web Logic Server?
I have to open a Jasper report on a button click event.
I have the following code in my backing bean for the command button action:
public String reportAction() throws FileNotFoundException,NamingException,
SQLException, IOException, JRException,
ClassNotFoundException,
InstantiationException,
IllegalAccessException {
InputStream input = new FileInputStream(new File("D:/jdev libs/report1.jasper"));
JasperDesign design;
design = JRXmlLoader.load(input);
JasperReport report = JasperCompileManager.compileReport(design);
Map parameters = new HashMap();
InitialContext initalContext = new InitialContext();
String dbUrl = (String)initalContext.lookup("jdbc:oracle:thin:@hoax4:1533:loansuat");
Class.forName("com.oracle.jdbc.Driver").newInstance();
Connection conn = DriverManager.getConnection(dbUrl, "ilpa", "ilpa");
JasperPrint print = JasperFillManager.fillReport(report, parameters, conn);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
JasperExportManager.exportReportToPdfStream(print, byteArrayOutputStream);
FacesContext.getCurrentInstance().responseComplete(); return null;
}
}
When I am running the page, I get following exception:
javax.faces.el.EvaluationException: net.sf.jasperreports.engine.JRException: java.io.UTFDataFormatException: Invalid UTF8 encoding.
I don't exactly know how to deploy the jasper report into the web logic server and what change I should make in the web.xml file.
Please help.