Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to deploy Jasper Report in Web Logic Server?

Sahar HassanFeb 27 2012 — edited Feb 28 2012
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 27 2012
Added on Feb 27 2012
18 comments
7,134 views