I am running an app I have developed in JSF/Java and as soon as I got JasperReports ExporttoPDFFile to start working and ran the app, the jrxml is compiled and displayed, then exported to a pdf file, that looks exactly as it should and the proper page is returned by the JSF and loads but then Glassfish 3 stops working and I have to start or restart it before I can continue to use the app again, everything works fine until the JasperReports compile and export... any ideas?
http://pastebin.com/mPwYvWh9 <--- Glassfish server log after running/crashing
JSF PAGE
<ui:define name="content">
<f:view>
<h:form styleClass="form_option">
<h:outputLabel value="Enter a query:"/>
<h:inputText value="#{controls.sql}" />
<h:commandButton action="#{controls.make}" value="Query"/>
<h:commandButton action="#{controls.reportGenerate}" value="Generate Report"/>
</h:form>
<br />
<h:form styleClass="form_option">
<h:outputLabel value="Choose a Query or Report on the Left"/>
<h:outputText escape="false" value=""/>
</h:form>
</f:view>
</ui:define>
code
public String reportGenerate()
throws JRException, ClassNotFoundException, SQLException, InstantiationException, IllegalAccessException{
String connectionURL = "jdbc:oracle:thin:@server:1521:ora";
String dbDriver = "oracle.jdbc.driver.OracleDriver";
Class.forName(dbDriver).newInstance();
Connection connection = DriverManager.getConnection(connectionURL, "PLANT", "PLANT");
JasperDesign design = JRXmlLoader.load("C:\\Projects\\WebApplication8\\web\\uploads\\TutorialSub_1.jrxml");
JasperReport jasperReport = JasperCompileManager.compileReport(design);
JasperPrint print = JasperFillManager.fillReport(jasperReport, null, connection);
JasperViewer.viewReport(print);
JasperExportManager.exportReportToPdfFile(print, "C:\\Projects\\WebApplication8\\web\\uploads\\TutorialSub_1.pdf");
return "queries";
}