Dear All Experts,
I am a newbies of Crystal Report. Since it is migrating the Crystal Report from exist platform to JBoss 7 with SQL Server 2012.
But the problem that after generating Crystal Report, it throws out the following Exception:
Exception:
15:07:31,130 INFO [org.apache.struts.tiles.TilesRequestProcessor] (http--127.0.0.1-8080-1) Tiles definition factory found for request processor ''.
15:07:47,444 INFO [td.etid.internal.report.Rp101Handler] (http--127.0.0.1-8080-1) reportName: C:\u04\tdetid\CrReports\RSrp101.rpt
15:07:47,444 INFO [stdout] (http--127.0.0.1-8080-1) tableAlias: rp101
15:07:47,444 INFO [stdout] (http--127.0.0.1-8080-1) OpenReportOptions._openAsReadOnly: 524288
15:07:50,287 ERROR [com.crystaldecisions.reports.reportdefinition.ReportDefinition] (http--127.0.0.1-8080-1) Report printer was not valid, switching to default printer.
15:07:51,599 ERROR [stderr] (http--127.0.0.1-8080-1) java.lang.NullPointerException
15:07:51,599 ERROR [stderr] (http--127.0.0.1-8080-1) at com.businessobjects.samples.JRCHelperSample.addDiscreteParameterValue(Unknown Source)
15:07:51,599 ERROR [stderr] (http--127.0.0.1-8080-1) at td.etid.internal.report.Rp101Handler.build(Unknown Source)
15:07:51,599 ERROR [stderr] (http--127.0.0.1-8080-1) at td.etid.internal.servlet.Rp101.doGet(Unknown Source)
15:07:51,599 ERROR [stderr] (http--127.0.0.1-8080-1) at td.etid.internal.servlet.Rp101.doPost(Unknown Source)
15:07:51,599 ERROR [stderr] (http--127.0.0.1-8080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
15:07:51,599 ERROR [stderr] (http--127.0.0.1-8080-1) at td.etid.internal.servlet.GenericInternalServlet.service(Unknown Source)
15:07:51,615 ERROR [stderr] (http--127.0.0.1-8080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
15:07:51,615 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
15:07:51,615 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
15:07:51,615 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
15:07:51,615 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
15:07:51,615 ERROR [stderr] (http--127.0.0.1-8080-1) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
15:07:51,615 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
15:07:51,615 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
15:07:51,615 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
15:07:51,615 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
15:07:51,630 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
15:07:51,630 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
15:07:51,630 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
15:07:51,630 ERROR [stderr] (http--127.0.0.1-8080-1) at java.lang.Thread.run(Thread.java:745)
For my source code,
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.as.naming.InitialContextFactory");
env.put(Context.PROVIDER_URL, "");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
Context ctx = new InitialContext(env);
DataSource datasource = (DataSource) ctx.lookup(url);
Connection conn = datasource.getConnection();
stmt = conn.prepareCall(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
stmt.setTimestamp(1, submissionStart);
stmt.setTimestamp(2, submissionEnd);
stmt.setInt(3, batchID);
stmt.setString(4, insurerID);
stmt.setInt(5, seqNo);
rs = stmt.executeQuery();
if (type.equalsIgnoreCase("preview")) {
ReportClientDocument clientDoc = new ReportClientDocument();
String reportName = "C:\\u04\\tdetid\\CrReports\\RSrp101.rpt";
logger.logInfo("reportName: " + reportName);
String tableAlias = "rp101";
System.out.println("tableAlias: " + tableAlias);
System.out.println("OpenReportOptions._openAsReadOnly: " + OpenReportOptions._openAsReadOnly);
clientDoc.open(reportName, OpenReportOptions._openAsReadOnly); // throw exception here
System.out.println("clientDoc.open()");
//ResultSet
JRCHelperSample.passResultSet(clientDoc, rs, tableAlias, "");
System.out.println("submissionStart: ");
if(submissionStart != null) {
System.out.println("submissionStart: " + df.format(submissionStart));
JRCHelperSample.addDiscreteParameterValue(clientDoc,
"@submissionStart", "", df.format(submissionStart));
} else {
JRCHelperSample.addDiscreteParameterValue(clientDoc,
"@submissionStart", "", "");
}
........