Project: Birt
Bug 141941 Use report parameter in script, preview in web viewer, system throws exception
Reported: 2006-05-16 03:39:35 | Status: closed fixed

Use report parameter in script, preview in web viewer, system throws exception Steps: 1.Create a report parameter, a ; string ; "abc" 1.Create a chart 2.Script: function beforeDrawAxisTitle(axis, title, scriptContext) { importPackage(Packages.org.eclipse.birt.chart.model.attribute); importPackage(Packages.org.eclipse.birt.chart.model.attribute.impl); { if (axis.getType() == AxisType.LINEAR_LITERAL) title.getCaption( ).setValue( scriptContext.getExternalContext().getObject().getParameterValue("a"));} title.getCaption().getColor( ).set( 208, 32, 0); title.getCaption().getFont().setItalic(true); title.getCaption().getFont().setRotation(90); title.getCaption().getFont().setStrikethrough(true); title.getCaption().getFont().setSize(14); title.getCaption().getFont().setName("Arial"); title.getOutline().setVisible(false); title.getOutline().setThickness(3); title.setBackground(ColorDefinitionImpl.ORANGE()); } 3.Preview in web viewer Actual Results: 1.System throws exception There are errors on the report page: - There are error(s) in Chart : 12 Error0 : null ( 1 time(s) ) detail : org.eclipse.birt.chart.exception.ChartException: $NO-RB$ null at org.eclipse.birt.chart.factory.Generator.render(Generator.java:1276) at org.eclipse.birt.chart.reportitem.ChartReportItemPresentationImpl.onRowSets(ChartReportItemPresentationImpl.java:449) at org.eclipse.birt.report.engine.presentation.LocalizedEmitter.startExtendedContent(LocalizedEmitter.java:669) at org.eclipse.birt.report.engine.presentation.LocalizedEmitter.startForeign(LocalizedEmitter.java:439) at org.eclipse.birt.report.engine.internal.document.v2.ReportContentLoaderV2$1.visitForeign(ReportContentLoaderV2.java:877) at org.eclipse.birt.report.engine.content.impl.ForeignContent.accept(ForeignContent.java:52) at org.eclipse.birt.report.engine.internal.document.v2.ReportContentLoaderV2$1.visit(ReportContentLoaderV2.java:784) at org.eclipse.birt.report.engine.internal.document.v2.ReportContentLoaderV2.startContent(ReportContentLoaderV2.java:764) at org.eclipse.birt.report.engine.internal.document.v2.ReportContentLoaderV2.outputPageRegion(ReportContentLoaderV2.java:378) at org.eclipse.birt.report.engine.internal.document.v2.ReportContentLoaderV2.excutePage(ReportContentLoaderV2.java:250) at org.eclipse.birt.report.engine.internal.document.v2.ReportContentLoaderV2.loadPage(ReportContentLoaderV2.java:151) at org.eclipse.birt.report.engine.internal.document.ReportContentLoader.loadPage(ReportContentLoader.java:50) at org.eclipse.birt.report.engine.api.impl.RenderTask.doRender(RenderTask.java:186) at org.eclipse.birt.report.engine.api.impl.RenderTask$PageRender.render(RenderTask.java:493) at org.eclipse.birt.report.engine.api.impl.RenderTask.render(RenderTask.java:428) at org.eclipse.birt.report.service.ReportEngineService.renderReport(Unknown Source) at org.eclipse.birt.report.service.ReportEngineService.renderReport(Unknown Source) at org.eclipse.birt.report.service.BirtViewerReportService.getPage(Unknown Source) at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.doExecution(Unknown Source) at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.__execute(Unknown Source) at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(Unknown Source) at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(Unknown Source) at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(Unknown Source) at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPage(Unknown Source) 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:324) at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(Unknown Source) at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(Unknown Source) 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:324) 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:453) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.eclipse.tomcat.internal.EclipseErrorReportValve.invoke(EclipseErrorReportValve.java:153) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) Caused by: java.lang.NullPointerException at org.eclipse.birt.chart.factory.RunTimeContext.externalizedMessage(RunTimeContext.java:504) at org.eclipse.birt.chart.render.AxesRenderer.renderEachAxis(AxesRenderer.java:3973) at org.eclipse.birt.chart.render.AxesRenderer.renderAxesLabels(AxesRenderer.java:2132) at org.eclipse.birt.chart.render.AxesRenderer.renderPlot(AxesRenderer.java:2263) at org.eclipse.birt.chart.render.AxesRenderer.render(AxesRenderer.java:299) at org.eclipse.birt.chart.factory.Generator.render(Generator.java:1271) ... 77 more Expected Results: 1.Can be previewed correctly.

Files changed in fix:
testsuites/org.eclipse.birt.report.tests.engine/src/org/eclipse/birt/report/tests/engine/EngineCase.java