cancel
Showing results for 
Search instead for 
Did you mean: 

NullPointerException when running report

Former Member
0 Kudos

I am trying to run the eclipse sample report but am receiving errors:


root cause 

java.lang.NullPointerException
com.crystaldecisions12.reports.common.filemanagement.PmtFileManager.int(SourceFile:249)
com.crystaldecisions12.reports.dataengine.i.a(SourceFile:4640)
com.crystaldecisions12.reports.dataengine.i.a(SourceFile:3992)
com.crystaldecisions12.reports.dataengine.h.a(SourceFile:2027)
com.crystaldecisions12.reports.dataengine.h.try(SourceFile:1878)
com.crystaldecisions12.reports.reportdefinition.ReportDocument.a(SourceFile:2378)
com.crystaldecisions12.reports.reportdefinition.ReportDocument.a(SourceFile:1716)
com.crystaldecisions12.reports.common.Document.a(SourceFile:521)
com.crystaldecisions12.reports.common.Document.loadDocument(SourceFile:437)
com.crystaldecisions12.reports.reportdefinition.ReportDocument.loadDocument(SourceFile:1516)
com.crystaldecisions12.reports.reportdefinition.ReportDocument.LoadDocument(SourceFile:1479)
com.businessobjects.reports.reportconverter.v12.c.a(SourceFile:59)
com.businessobjects.reports.reportconverter.v12.V12SaveLoader.a(SourceFile:159)
com.businessobjects.reports.loader.ReportLoader.a(SourceFile:205)
com.businessobjects.reports.sdk.JRCReportLoader.a(SourceFile:137)
com.businessobjects.reports.sdk.JRCReportLoader.a(SourceFile:76)
com.businessobjects.reports.sdk.requesthandler.ReportDocumentRequestHandler.a(SourceFile:137)
com.businessobjects.reports.sdk.JRCCommunicationAdapter.<init>(SourceFile:228)
com.businessobjects.sdk.erom.jrc.a.<init>(SourceFile:43)
com.businessobjects.sdk.erom.jrc.ReportAgentFactory.createAgent(SourceFile:46)
com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.<init>(SourceFile:703)
com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:662)
com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:632)
com.crystaldecisions.sdk.occa.report.application.ClientDocument.if(SourceFile:504)
com.crystaldecisions.sdk.occa.report.application.ClientDocument.open(SourceFile:669)
com.crystaldecisions.reports.sdk.ReportClientDocument.open(SourceFile:80)
org.apache.jsp.index_jsp._jspService(index_jsp.java:84)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


My index.jsp:


<%@page import="

com.crystaldecisions.reports.sdk.</span>" %&gt;<br><br>&lt;%@<span style="color:#cc7832;font-weight:bold;">page </span>import="<span style="color:#6a8759;">com.crystaldecisions.sdk.occa.report.reportsource." %>

<%@page import="com.crystaldecisions.sdk.occa.report.lib.</span>" %&gt;<br><br><span style="color:#cc7832;font-weight:bold;">&lt;%<br></span><span style="color:#cc7832;font-weight:bold;"><br></span><span style="color:#cc7832;font-weight:bold;">  </span><span style="color:#cc7832;">Object reportSource = session.getAttribute(</span><span style="color:#6a8759;">"reportSource"</span><span style="color:#cc7832;">);<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">  if(reportSource == null)<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">  {<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">    ReportClientDocument reportClientDoc = new ReportClientDocument();<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">    String report = </span><span style="color:#6a8759;">"/Sample Reports/Customer Profile Report.rpt"</span><span style="color:#cc7832;">;<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">    reportClientDoc.open(report, </span><span style="color:#6897bb;">0</span><span style="color:#cc7832;">);<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">    reportSource = reportClientDoc.getReportSource();<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">    session.setAttribute(</span><span style="color:#6a8759;">"reportSource"</span><span style="color:#cc7832;">, reportSource);<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">  }<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">  CrystalReportViewer viewer = new CrystalReportViewer();<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">  viewer.setReportSource(reportSource);<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">  viewer.setOwnPage(true);<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;">  viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);<br></span><span style="color:#cc7832;"><br></span><span style="color:#cc7832;font-weight:bold;">%&gt;<br></span>&lt;%@<span style="color:#cc7832;font-weight:bold;">page </span>import="<span style="color:#6a8759;">com.crystaldecisions.report.web.viewer."%>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Sorry, editor was acting up...here is my index.jsp:

<%@page import="com.crystaldecisions.reports.sdk.*" %>

<%@page import="com.crystaldecisions.sdk.occa.report.reportsource.*" %>

<%@page import="com.crystaldecisions.sdk.occa.report.lib.*" %>

<%

  Object reportSource = session.getAttribute("reportSource");

  if(reportSource == null)

  {

  ReportClientDocument reportClientDoc = new ReportClientDocument();

  String report = "/Sample Reports/Customer Profile Report.rpt";

  reportClientDoc.open(report, 0);

  reportSource = reportClientDoc.getReportSource();

  session.setAttribute("reportSource", reportSource);

  }

  CrystalReportViewer viewer = new CrystalReportViewer();

  viewer.setReportSource(reportSource);

  viewer.setOwnPage(true);

  viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);

%>
<%@page import="com.crystaldecisions.report.web.viewer.*"%>

Above the null pointer exception I get this:

javax.servlet.ServletException: com.crystaldecisions.sdk.occa.report.lib.ReportSDKException---- Error code:-2147467259 Error code name:failed

I don't get any errors in the debugger.

Also, when I try to run the report directly as a jsp, i get returned a page with a grey table that says "Error" but no actual error. Again, no errors in the bugger, just a blank error page.

This seems to run fine when running through Eclipse. However I am using Intellij IDEA now, and I have tried to migrate the eclipse settings over as best I could so perhaps something is acting up there, but I have no idea where to look.