Project: Birt
Bug 302367 Unexpected Exception thrown out when preview data item using Birt Function BirtDateTime.month() [0802]
Reported: 2010-02-10 01:06:47 | Status: closed fixed

Description: Exception thrown out when preview data item using Birt Function BirtDateTime.month() [0802] Build: <2.5.2.v20100210-0630> Steps to reproduce: 1. New a data item using Birt Function BirtDateTime.month() without detail parameter 2. Preview Actual result: Unexpected Exception thrown out Expect result: Releated exception should thrown out ErrorLog: 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.runAndRenderReport(ReportEngineService.java:926) at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(BirtViewerReportService.java:973) at org.eclipse.birt.report.service.actionhandler.BirtGetPageAllActionHandler.__execute(BirtGetPageAllActionHandler.java:131) 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.handleGetPageAll(BirtDocumentProcessor.java:183) 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.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.GeneratedMethodAccessor38.invoke(Unknown Source) 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) 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.handleRequest(ServletRegistration.java:90) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:59) 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:502) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:380) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) 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:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:880) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:748) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213) 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:520) Caused by: org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:186) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:75) at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:920) ... 48 more Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at org.eclipse.birt.core.script.function.bre.BirtDateTime$Function_Month.getValue(BirtDateTime.java:271) at org.eclipse.birt.core.script.function.bre.Function_temp.execute(BreUtility.java:50) at org.eclipse.birt.core.script.function.bre.BirtDateTime.execute(BirtDateTime.java:1322) at org.eclipse.birt.core.script.functionservice.impl.ScriptFunction.execute(ScriptFunction.java:146) at org.eclipse.birt.core.script.functionservice.impl.CategoryWrapper$1.call(CategoryWrapper.java:67) at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119) at org.mozilla.javascript.gen.c214._c0(:0) at org.mozilla.javascript.gen.c214.call() at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003) at org.mozilla.javascript.gen.c214.call() at org.mozilla.javascript.gen.c214.exec() at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawScript(JavascriptEvalUtil.java:95) at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScript(JavascriptEvalUtil.java:134) at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJSAsExpr(ScriptEvalUtil.java:769) at org.eclipse.birt.data.engine.expression.ExprEvaluateUtil.doEvaluateRawExpression(ExprEvaluateUtil.java:266) at org.eclipse.birt.data.engine.expression.ExprEvaluateUtil.evaluateRawExpression(ExprEvaluateUtil.java:232) at org.eclipse.birt.data.engine.impl.PreparedDummyQuery$ResultIterator.(PreparedDummyQuery.java:531) at org.eclipse.birt.data.engine.impl.PreparedDummyQuery$ResultIterator.(PreparedDummyQuery.java:508) at org.eclipse.birt.data.engine.impl.PreparedDummyQuery$QueryResults.getResultIterator(PreparedDummyQuery.java:367) at org.eclipse.birt.report.engine.data.dte.QueryResultSet.(QueryResultSet.java:98) at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:168) at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:265) at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1875) at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80) at org.eclipse.birt.report.engine.executor.DataItemExecutor.execute(DataItemExecutor.java:75) at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43) at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34) at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65) at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90) at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:99) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:170) ... 50 more

Files changed in fix:
data/org.eclipse.birt.core.script.function/src/org/eclipse/birt/core/script/function/bre/BirtDateTime.java data/org.eclipse.birt.core.script.function/src/org/eclipse/birt/core/script/function/bre/BirtDuration.java data/org.eclipse.birt.core.script.function/src/org/eclipse/birt/core/script/function/bre/BirtMath.java data/org.eclipse.birt.core.script.function/src/org/eclipse/birt/core/script/function/bre/BreUtility.java data/org.eclipse.birt.core.script.function/src/org/eclipse/birt/core/script/function/i18n/Messages.java