Bug 176334 [regression]EngineException when preview the old report.
Description: EngineException when preview the old report. Build number:2.2.0.v200703050630 Steps to reproduce: 1. Open attached report. 2. Preview in Web Viewer/html. Expected result: Preview is OK without exception. Actual result: - There are errors evaluating script "row["CUSTOMERNAME_1"]". Error.ScriptEvaluationError ( 102 time(s) ) detail : org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "row["CUSTOMERNAME_1"]". at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:554) at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:527) at org.eclipse.birt.report.engine.data.dte.DteResultSet.evaluate(DteResultSet.java:286) at org.eclipse.birt.report.engine.extension.internal.RowSet.evaluate(RowSet.java:120) at org.eclipse.birt.chart.reportitem.BIRTDataRowEvaluator.evaluate(BIRTDataRowEvaluator.java:44) at org.eclipse.birt.chart.internal.datafeed.DataProcessor.mapToChartResultSet(DataProcessor.java:396) at org.eclipse.birt.chart.internal.datafeed.DataProcessor.generateRuntimeSeries(DataProcessor.java:485) at org.eclipse.birt.chart.factory.Generator.bindData(Generator.java:571) at org.eclipse.birt.chart.reportitem.ChartReportItemPresentationImpl.onRowSets(ChartReportItemPresentationImpl.java:411) at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.processExtendedContent(LocalizedContentVisitor.java:650) at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.visitForeign(LocalizedContentVisitor.java:369) at org.eclipse.birt.report.engine.content.impl.ForeignContent.accept(ForeignContent.java:59) at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.localize(LocalizedContentVisitor.java:99) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:38) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:90) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:77) at org.eclipse.birt.report.engine.internal.document.v3.ReportContentLoaderV3.loadPage(ReportContentLoaderV3.java:51) at org.eclipse.birt.report.engine.internal.document.ReportContentLoader.loadPage(ReportContentLoader.java:55) at org.eclipse.birt.report.engine.api.impl.RenderTask$PageRender.load(RenderTask.java:475) at org.eclipse.birt.report.engine.api.impl.RenderTask$InnerRender.render(RenderTask.java:413) at org.eclipse.birt.report.engine.api.impl.RenderTask.render(RenderTask.java:311) 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.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.BirtChangeParameterActionHandler.doRenderPage(Unknown Source) at org.eclipse.birt.report.service.actionhandler.AbstractChangeParameterActionHandler.__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.handleChangeParameter(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:585) 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: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: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:595)Caused by: org.mozilla.javascript.EvaluatorException: org.eclipse.birt.data.engine.core.DataException: Invalid expression to retrieve value in presentation. at org.eclipse.birt.report.engine.data.dte.NativeRowObject.get(NativeRowObject.java:93) at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1263) at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1301) at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1283) at org.mozilla.javascript.gen.c53._c0(<inline>:1) at org.mozilla.javascript.gen.c53.call(<inline>) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769) at org.mozilla.javascript.gen.c53.call(<inline>) at org.mozilla.javascript.gen.c53.exec(<inline>) at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContext.java:223) at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:548) ... 91 more - There are errors evaluating script "row["CUSTOMERNUMBER_2"]". Error.ScriptEvaluationError ( 102 time(s) ) detail : org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "row["CUSTOMERNUMBER_2"]". at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:554) at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:527) at org.eclipse.birt.report.engine.data.dte.DteResultSet.evaluate(DteResultSet.java:286) at org.eclipse.birt.report.engine.extension.internal.RowSet.evaluate(RowSet.java:120) at org.eclipse.birt.chart.reportitem.BIRTDataRowEvaluator.evaluate(BIRTDataRowEvaluator.java:44) at org.eclipse.birt.chart.internal.datafeed.DataProcessor.mapToChartResultSet(DataProcessor.java:396) at org.eclipse.birt.chart.internal.datafeed.DataProcessor.generateRuntimeSeries(DataProcessor.java:485) at org.eclipse.birt.chart.factory.Generator.bindData(Generator.java:571) at org.eclipse.birt.chart.reportitem.ChartReportItemPresentationImpl.onRowSets(ChartReportItemPresentationImpl.java:411) at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.processExtendedContent(LocalizedContentVisitor.java:650) at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.visitForeign(LocalizedContentVisitor.java:369) at org.eclipse.birt.report.engine.content.impl.ForeignContent.accept(ForeignContent.java:59) at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.localize(LocalizedContentVisitor.java:99) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:38) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:90) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:98) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportExecutor.execute(LocalizedReportExecutor.java:77) at org.eclipse.birt.report.engine.internal.document.v3.ReportContentLoaderV3.loadPage(ReportContentLoaderV3.java:51) at org.eclipse.birt.report.engine.internal.document.ReportContentLoader.loadPage(ReportContentLoader.java:55) at org.eclipse.birt.report.engine.api.impl.RenderTask$PageRender.load(RenderTask.java:475) at org.eclipse.birt.report.engine.api.impl.RenderTask$InnerRender.render(RenderTask.java:413) at org.eclipse.birt.report.engine.api.impl.RenderTask.render(RenderTask.java:311) 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.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.BirtChangeParameterActionHandler.doRenderPage(Unknown Source) at org.eclipse.birt.report.service.actionhandler.AbstractChangeParameterActionHandler.__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.handleChangeParameter(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:585) 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: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: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:595)Caused by: org.mozilla.javascript.EvaluatorException: org.eclipse.birt.data.engine.core.DataException: Invalid expression to retrieve value in presentation. at org.eclipse.birt.report.engine.data.dte.NativeRowObject.get(NativeRowObject.java:93) at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1263) at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1301) at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1283) at org.mozilla.javascript.gen.c54._c0(<inline>:1) at org.mozilla.javascript.gen.c54.call(<inline>) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769) at org.mozilla.javascript.gen.c54.call(<inline>) at org.mozilla.javascript.gen.c54.exec(<inline>) at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContext.java:223) at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:548) ... 91 more Error log:see above.
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/PreparedQuery.java
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.eclipse.birt.core.data.ExpressionUtil;
import org.eclipse.birt.data.engine.api.DataEngineContext;
import org.eclipse.birt.data.engine.api.IBaseExpression;
import org.eclipse.birt.data.engine.api.IBaseQueryDefinition;
import org.eclipse.birt.data.engine.api.IBaseTransform;
import org.eclipse.birt.data.engine.api.IConditionalExpression;
import org.eclipse.birt.data.engine.api.IGroupDefinition;
import org.eclipse.birt.data.engine.api.IQueryResults;
import org.eclipse.birt.data.engine.api.IScriptExpression;
import org.eclipse.birt.data.engine.api.ISubqueryDefinition;
import org.eclipse.birt.data.engine.api.querydefn.ConditionalExpression;
import org.eclipse.birt.data.engine.core.DataException;
import org.eclipse.birt.data.engine.expression.CompiledExpression;
import org.eclipse.birt.data.engine.expression.ExpressionCompiler;
import org.eclipse.birt.data.engine.i18n.ResourceConstants;
import org.eclipse.birt.data.engine.impl.aggregation.AggregateRegistry;
import org.eclipse.birt.data.engine.impl.aggregation.AggregateTable;
import org.eclipse.birt.data.engine.odi.IResultIterator;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;
/** 
 * Two main functions for PreparedDataSourceQuery or PreparedSubQuery:
 * 		1: prepare group, subquery and expressions
 * 		2: query preparation and sub query execution
 */
final class PreparedQuery