cancel
Showing results for 
Search instead for 
Did you mean: 

null pointer exception on any report with parameters

Former Member
0 Kudos

Hello! <br /><br />I&#39;m having some problems viewing reports that have parameters: the report viewer throws a null pointer exception, and since it&#39;s not my code that&#39;s doing it, I can&#39;t even view the stack trace. Everything was fine when I had the code to generate the viewer and the report source inside of a servlet, but when I moved it to a POJO, this thing started. I can view every report, regardless of whether or not it has data saved in it, except the ones that have parameter fields.<br /><br />Could anyone help me out w/ this and let me know what the problem is and what I can do to fix it? I don&#39;t understand why it would work when everything was done within a servelt and this happens as soon as I move it to a pojo.<br /><br />Thanks so much!<br /><br />Here&#39;s the code for the pojo:<br /><br />

<br />/*<br /> * ReportViewerFactory.java<br /> *<br /> * Created on March 30, 2007, 10:06 AM<br /> */<br /><br />package com.ruffalocody.reports;<br /><br />import com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase;<br />// CR View:<br />import com.crystaldecisions.report.web.viewer.*;<br />import com.crystaldecisions.sdk.occa.report.reportsource.IReportSource;<br />// CR Export:<br />import com.crystaldecisions.report.web.viewer.ReportExportControl;<br />import com.crystaldecisions.sdk.occa.report.exportoptions.ExportOptions;<br />import com.crystaldecisions.sdk.occa.report.exportoptions.IPDFExportFormatOptions;<br />import com.crystaldecisions.sdk.occa.report.exportoptions.PDFExportFormatOptions;<br />import com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat;<br />import com.crystaldecisions.sdk.occa.report.exportoptions.RTFWordExportFormatOptions;<br /><br />import java.sql.*;<br /><br />/**<br /> * Creates a report viewer, weather for viewing or exporting purposes.<br /> *<br /> * @author aerohner<br /> */<br />public class ReportViewerFactory<br />{<br />    private ReportServerControl rptViewer;<br />        /** Creates a new instance of ReportViewerFactory */<br />    public ReportViewerFactory(ReportRequest rptReq)<br />	throws ReportSDKExceptionBase<br />    {<br />		IReportSource rptSrc = rptReq.getReportSource();<br /><br />		if (rptReq.getRequestedAction() == ReportRequest.VIEW)<br />			rptViewer = createViewer(rptReq);<br /><br />		else if(rptReq.getRequestedAction() == ReportRequest.EXPORT)<br />			rptViewer = createExporter(rptReq);<br /><br />    }// end constructor ReportViewerFactory()<br />        private ReportServerControl createViewer(ReportRequest rptReq) <br />	throws ReportSDKExceptionBase<br />    {<br />		ReportServerControl viewer = new CrystalReportViewer();<br /><br />		viewer.setOwnPage(true);<br />		viewer.setOwnForm(true);<br /><br />		viewer.setReportSource(rptReq.getReportSource());<br /><br />		return viewer;<br /><br />    }// end createViewer(.)<br />        private ReportServerControl createExporter(ReportRequest rptReq) <br />	throws ReportSDKExceptionBase<br />    {<br />		// getting values out of rptReq<br />		int exportFormatInt = rptReq.getExportFormat();<br />		int start = rptReq.getPageStart();<br />		int end = rptReq.getPageEnd();<br /><br />		ReportExportControl rptExportControl = new ReportExportControl();<br />		ExportOptions exportOptions = new ExportOptions();<br /><br />		ReportExportFormat expFormat = <br />			ReportExportFormat.from_int(rptReq.getExportFormat());<br /><br />		// if user requested to export a specified range of pages.<br />		if(!rptReq.getExportAllPages())<br />		{<br />			// TODO check if range is valid<br /><br />			if(exportFormatInt == ReportExportFormat._RTF ||<br />				exportFormatInt == ReportExportFormat._MSWord)<br />			{<br />			RTFWordExportFormatOptions rtfFormatOpts = <br />				new RTFWordExportFormatOptions();<br /><br />			rtfFormatOpts.setStartPageNumber(start);<br />			rtfFormatOpts.setEndPageNumber(end);<br /><br />			exportOptions.setFormatOptions(rtfFormatOpts);<br />			}// end if rtf<br />			else if (exportFormatInt == ReportExportFormat._PDF)<br />			{<br />			IPDFExportFormatOptions pdfFormatOpts = <br />				new PDFExportFormatOptions();<br />			pdfFormatOpts.setStartPageNumber(start);<br />			pdfFormatOpts.setEndPageNumber(end);<br /><br />			exportOptions.setFormatOptions(pdfFormatOpts);<br />			}// end else if pdf<br />		}// end if range of pages<br /><br />		rptExportControl.setReportSource(rptReq.getReportSource());<br /><br />		exportOptions.setExportFormatType(expFormat);<br /><br />		rptExportControl.setExportOptions(exportOptions);<br />		rptExportControl.setExportAsAttachment(true);	<br /><br />		return rptExportControl;<br /><br />    }// end createExporter(.)<br />        public ReportServerControl getReportViewer()<br />    {<br />		return rptViewer;<br />    }// end getReportViewer()<br /><br />    public void setReportViewer(ReportServerControl rptViewer)<br />    {<br />		this.rptViewer = rptViewer;<br />    }// end setReportViewer(.)<br />    }// end ReportViewerFactory<br />

<br /><br />Then the ReportServlet that initiates this class gets the viewer from this class and the report source, sets them as session attributes and does a request dispatcher forward to view jsp.<br /><br />view.jsp just does the following:<br /><br />

<br /><%<br />	ReportServerControl viewer = (ReportServerControl)<br />	    request.getSession(false).getAttribute("viewer");<br />	IReportSource rptSrc = (IReportSource)request.getSession(true).getAttribute("reportSource");<br />		if (viewer != null)<br />	{<br />	    viewer.processHttpRequest(request,response, <br />		getServletConfig().getServletContext(),null);<br />		    if(!(viewer instanceof CrystalReportViewer))<br />	    {<br />		// trying to avoid "report source expired"<br />		// error when viewing the next page of report<br />		viewer.dispose();<br />	    }<br />	}// end if viewer null<br />	else<br />	{<br />	    RequestDispatcher rd = request.getRequestDispatcher("errorPage");<br />	    request.setAttribute("errorMsg", "view.jsp: viewer is null");<br />	    rd.forward(request, response);<br />	}// end else viewer not null<br />    %><br />

<br /><br /><br />

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I'd use CrystalReportViewer class instance rather than ReportServerControl.

Also, if you specify the context parameter crystal_exception_info, you should get a stack trace from the CrystalReportViewer. Search for KBase c2016824 on the support site.

Ted Ueda

Former Member
0 Kudos

I seem to be getting the same issue - also applies when CR4E is used to preview a report with params.

Is there any resolution to this yet?

stack trace:

com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed

at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)

at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)

at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.getPage(Unknown Source)

at com.businessobjects.crystalreports.designer.preview.ReportSourceProxy.getPage(Unknown Source)

at com.businessobjects.crystalreports.viewer.core.rs.b.if(Unknown Source)

at com.businessobjects.crystalreports.viewer.core.aw.a(Unknown Source)

at com.businessobjects.crystalreports.viewer.core.aw.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.NullPointerException

at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:870)

at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:811)

at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)

at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:830)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)

at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1687)

at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1653)

at com.crystaldecisions.reports.queryengine.driverImpl.o.eC(Unknown Source)

at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)

at com.crystaldecisions.reports.queryengine.ap.ea(Unknown Source)

at com.crystaldecisions.reports.queryengine.ap.h(Unknown Source)

at com.crystaldecisions.reports.queryengine.ap.dV(Unknown Source)

at com.crystaldecisions.reports.queryengine.ax.if(Unknown Source)

at com.crystaldecisions.reports.queryengine.bc.if(Unknown Source)

at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)

at com.crystaldecisions.reports.queryengine.bc.try(Unknown Source)

at com.crystaldecisions.reports.queryengine.bc.for(Unknown Source)

at com.crystaldecisions.reports.reportdefinition.datainterface.g.a(Unknown Source)

at com.crystaldecisions.reports.dataengine.m.a(Unknown Source)

at com.crystaldecisions.reports.dataengine.m.a(Unknown Source)

at com.crystaldecisions.reports.dataengine.bk.if(Unknown Source)

at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.h(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bf.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.ca.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.a9.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.m.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.m.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.p.l(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.p.void(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.p.l(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.p.aB(Unknown Source)

at com.businessobjects.reports.sdk.b.b.byte(Unknown Source)

... 13 more

Caused by:

java.lang.NullPointerException

at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:870)

at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:811)

at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)

at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:830)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)

at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1687)

at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1653)

at com.crystaldecisions.reports.queryengine.driverImpl.o.eC(Unknown Source)

at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)

at com.crystaldecisions.reports.queryengine.ap.ea(Unknown Source)

at com.crystaldecisions.reports.queryengine.ap.h(Unknown Source)

at com.crystaldecisions.reports.queryengine.ap.dV(Unknown Source)

at com.crystaldecisions.reports.queryengine.ax.if(Unknown Source)

at com.crystaldecisions.reports.queryengine.bc.if(Unknown Source)

at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)

at com.crystaldecisions.reports.queryengine.bc.try(Unknown Source)

at com.crystaldecisions.reports.queryengine.bc.for(Unknown Source)

at com.crystaldecisions.reports.reportdefinition.datainterface.g.a(Unknown Source)

at com.crystaldecisions.reports.dataengine.m.a(Unknown Source)

at com.crystaldecisions.reports.dataengine.m.a(Unknown Source)

at com.crystaldecisions.reports.dataengine.bk.if(Unknown Source)

at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.h(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bf.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.ca.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.a9.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.m.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.m.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.p.l(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.p.void(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.p.l(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.e.p.aB(Unknown Source)

at com.businessobjects.reports.sdk.b.b.byte(Unknown Source)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)

at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)

at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.getPage(Unknown Source)

at com.businessobjects.crystalreports.designer.preview.ReportSourceProxy.getPage(Unknown Source)

at com.businessobjects.crystalreports.viewer.core.rs.b.if(Unknown Source)

at com.businessobjects.crystalreports.viewer.core.aw.a(Unknown Source)

at com.businessobjects.crystalreports.viewer.core.aw.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Former Member
0 Kudos

- PdfExporter: caught Exception in PDFFormatter.finalizeFormatJob (from destination?); aborting export

java.lang.IllegalArgumentException

at com.crystaldecisions.reports.exporters.destination.disk.c.a(Unknown Source)

at com.crystaldecisions.reports.exporters.format.page.pdf.b.a(Unknown Source)

at com.crystaldecisions.reports.a.e.if(Unknown Source)

at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)

at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)

at com.businessobjects.reports.sdk.b.i.int(Unknown Source)

at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)

at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)

at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.ReportSource.export(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.export(Unknown Source)

at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.export(Unknown Source)

at ReportExporter.exportReport(ReportExporter.java:213)

at CrystalReportRunner.exportReport(CrystalReportRunner.java:159)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)

at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)

at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)

at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)

at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)

- Disk Exporter: finalizing export to destination

- JRCAgent2 detected an exception: java.lang.NullPointerException:

at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:876)

at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:822)

at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)

at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:841)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)

at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1696)

at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1662)

at com.crystaldecisions.reports.queryengine.driverImpl.o.ew(Unknown Source)

at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)

at com.crystaldecisions.reports.queryengine.ao.d4(Unknown Source)

at com.crystaldecisions.reports.queryengine.ao.f(Unknown Source)

at com.crystaldecisions.reports.queryengine.ao.dP(Unknown Source)

at com.crystaldecisions.reports.queryengine.av.if(Unknown Source)

at com.crystaldecisions.reports.queryengine.ba.if(Unknown Source)

at com.crystaldecisions.reports.queryengine.ba.do(Unknown Source)

at com.crystaldecisions.reports.queryengine.ba.try(Unknown Source)

at com.crystaldecisions.reports.queryengine.ba.for(Unknown Source)

at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)

at com.crystaldecisions.reports.dataengine.j.a(Unknown Source)

at com.crystaldecisions.reports.dataengine.j.a(Unknown Source)

at com.crystaldecisions.reports.dataengine.a9.if(Unknown Source)

at com.crystaldecisions.reports.dataengine.a9.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.g(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.i.g(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.for(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)

at com.crystaldecisions.reports.formatter.formatter.objectformatter.bf.a(Unknown Source)