Project: Birt
Bug 312759 NPE when run report has variable and uses library
Reported: 2010-05-13 04:45:24 | Status: closed fixed

Build number:2.6.0.v20100513-1121 Steps to reproduce: 1. New a library. 2. New a report, add a report variable,use the library. 3. Preview report Expected result:no exception. Actual result:NPE Error log: org.eclipse.birt.report.service.api.ReportServiceException: Error happened while running the report at org.eclipse.birt.report.service.ReportEngineService.throwDummyException(ReportEngineService.java:1097) at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1316) at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158) at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81) at org.eclipse.birt.report.service.actionhandler.BirtGetPageActionHandler.__checkDocumentExists(BirtGetPageActionHandler.java:58) at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.prepareParameters(AbstractGetPageActionHandler.java:119) at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.__execute(AbstractGetPageActionHandler.java:104) at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90) at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47) at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143) at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPage(BirtDocumentProcessor.java:87) 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:597) at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112) at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66) 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:597) 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) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122) at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:318) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) Caused by: org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:261) at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:85) at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1307) ... 52 more Caused by: org.eclipse.birt.report.engine.api.EngineException: Failed to save design! at org.eclipse.birt.report.engine.api.impl.ReportDocumentWriter.saveDesign(ReportDocumentWriter.java:195) at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:214) ... 54 more Caused by: java.lang.NullPointerException at org.eclipse.birt.report.model.util.ReportDesignSerializerImpl.newElement(ReportDesignSerializerImpl.java:2869) at org.eclipse.birt.report.model.util.ReportDesignSerializerImpl.newElement(ReportDesignSerializerImpl.java:2833) at org.eclipse.birt.report.model.util.ReportDesignSerializerImpl.createNewElement(ReportDesignSerializerImpl.java:1260) at org.eclipse.birt.report.model.util.ReportDesignSerializerImpl.localize(ReportDesignSerializerImpl.java:1319) at org.eclipse.birt.report.model.util.ReportDesignSerializerImpl.visitDesignElement(ReportDesignSerializerImpl.java:266) at org.eclipse.birt.report.model.util.ReportDesignSerializerImpl.visitContentElement(ReportDesignSerializerImpl.java:2993) at org.eclipse.birt.report.model.elements.ElementVisitorImpl.visitVariableElement(ElementVisitorImpl.java:921) at org.eclipse.birt.report.model.elements.VariableElement.apply(VariableElement.java:55) at org.eclipse.birt.report.model.util.ReportDesignSerializerImpl.handleContentElementValue(ReportDesignSerializerImpl.java:2269) at org.eclipse.birt.report.model.util.ReportDesignSerializerImpl.localizePropertyValues(ReportDesignSerializerImpl.java:2056) at org.eclipse.birt.report.model.util.ReportDesignSerializerImpl.localizeDesign(ReportDesignSerializerImpl.java:1394) at org.eclipse.birt.report.model.util.ReportDesignSerializerImpl.visitReportDesign(ReportDesignSerializerImpl.java:212) at org.eclipse.birt.report.model.elements.ReportDesign.apply(ReportDesign.java:65) at org.eclipse.birt.report.model.api.util.DocumentUtil.localizeDesign(DocumentUtil.java:90) at org.eclipse.birt.report.model.api.util.DocumentUtil.serialize(DocumentUtil.java:67) at org.eclipse.birt.report.engine.api.impl.ReportDocumentWriter.saveDesign(ReportDocumentWriter.java:186) ... 55 more

Files changed in fix:
model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/util/ReportDesignSerializerImpl.java