Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313849 - [Auto-S]Fail to run report using script this.addaction()
Summary: [Auto-S]Fail to run report using script this.addaction()
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.6.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.6.0 RC2   Edit
Assignee: Rick Lu CLA
QA Contact: Liwen Chen CLA
URL:
Whiteboard: Autoed-S
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-21 01:33 EDT by Xiaoying Gu CLA
Modified: 2010-05-25 05:47 EDT (History)
1 user (show)

See Also:


Attachments
report (2.72 KB, application/octet-stream)
2010-05-21 01:33 EDT, Xiaoying Gu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaoying Gu CLA 2010-05-21 01:33:44 EDT
Created attachment 169457 [details]
report

Build number:2.6.0.v20100521-0630

Steps to reproduce:
1. Preview attached report. the report has script in label onprepare which add a hyperlink on the label

Expected result:hyperlink is added

Actual result:Exception. 

Error log:
Label (id = 7): 
- There are errors evaluating script "ac = this.getReport().createAction();
ac.setLinkType(this.constants.ACTION_LINK_TYPE_HYPERLINK);
ac.setURI("\'http://www.actuate.com\'");
ac.setTargetWindow("_parent");
this.addAction(ac);
":
Wrapped org.eclipse.birt.report.model.api.metadata.PropertyValueException: The value "org.eclipse.birt.report.model.api.elements.structures.Action@1c23196" is invalid with the type "structure". (/report/body/label[@id="7"]/method[@name="onPrepare"]#5) 
birt.core.JavascriptCommonError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "ac = this.getReport().createAction();
ac.setLinkType(this.constants.ACTION_LINK_TYPE_HYPERLINK);
ac.setURI("\'http://www.actuate.com\'");
ac.setTargetWindow("_parent");
this.addAction(ac);
":
Wrapped org.eclipse.birt.report.model.api.metadata.PropertyValueException: The value "org.eclipse.birt.report.model.api.elements.structures.Action@1c23196" is invalid with the type "structure". (/report/body/label[@id="7"]/method[@name="onPrepare"]#5)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1210)
	at org.eclipse.birt.report.engine.api.impl.ScriptedDesignHandler.processOnPrepareScript(ScriptedDesignHandler.java:202)
	at org.eclipse.birt.report.engine.api.impl.ScriptedDesignHandler.handleOnPrepare(ScriptedDesignHandler.java:109)
	at org.eclipse.birt.report.engine.api.impl.ScriptedDesignVisitor.visitLabel(ScriptedDesignVisitor.java:270)
	at org.eclipse.birt.report.model.api.DesignVisitorImpl$Forwarder.visitLabel(DesignVisitorImpl.java:1005)
	at org.eclipse.birt.report.model.elements.Label.apply(Label.java:60)
	at org.eclipse.birt.report.model.api.DesignVisitorImpl.apply(DesignVisitorImpl.java:127)
	at org.eclipse.birt.report.engine.api.impl.ScriptedDesignVisitor.visitReportDesign(ScriptedDesignVisitor.java:106)
	at org.eclipse.birt.report.model.api.DesignVisitorImpl$Forwarder.visitReportDesign(DesignVisitorImpl.java:1211)
	at org.eclipse.birt.report.model.elements.ReportDesign.apply(ReportDesign.java:65)
	at org.eclipse.birt.report.model.api.DesignVisitorImpl.apply(DesignVisitorImpl.java:127)
	at org.eclipse.birt.report.engine.api.impl.EngineTask.prepareDesign(EngineTask.java:1660)
	at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:96)
	at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:75)
	at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:920)
	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: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:212)
	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.core.exception.CoreException: There are errors evaluating script "ac = this.getReport().createAction();
ac.setLinkType(this.constants.ACTION_LINK_TYPE_HYPERLINK);
ac.setURI("\'http://www.actuate.com\'");
ac.setTargetWindow("_parent");
this.addAction(ac);
":
Wrapped org.eclipse.birt.report.model.api.metadata.PropertyValueException: The value "org.eclipse.birt.report.model.api.elements.structures.Action@1c23196" is invalid with the type "structure". (/report/body/label[@id="7"]/method[@name="onPrepare"]#5)
	at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:287)
	at org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:152)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:746)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:726)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:708)
	at org.eclipse.birt.report.engine.api.impl.ScriptedDesignHandler.processOnPrepareScript(ScriptedDesignHandler.java:194)
	... 62 more
Caused by: org.mozilla.javascript.WrappedException: Wrapped org.eclipse.birt.report.model.api.metadata.PropertyValueException: The value "org.eclipse.birt.report.model.api.elements.structures.Action@1c23196" is invalid with the type "structure". (/report/body/label[@id="7"]/method[@name="onPrepare"]#5)
	at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1654)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:175)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
	at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
	at org.mozilla.javascript.gen.c14._c0(/report/body/label[@id="7"]/method[@name="onPrepare"]:5)
	at org.mozilla.javascript.gen.c14.call(/report/body/label[@id="7"]/method[@name="onPrepare"])
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003)
	at org.mozilla.javascript.gen.c14.call(/report/body/label[@id="7"]/method[@name="onPrepare"])
	at org.mozilla.javascript.gen.c14.exec(/report/body/label[@id="7"]/method[@name="onPrepare"])
	at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:282)
	... 67 more
Caused by: org.eclipse.birt.report.model.api.metadata.PropertyValueException: The value "org.eclipse.birt.report.model.api.elements.structures.Action@1c23196" is invalid with the type "structure".
	at org.eclipse.birt.report.model.metadata.StructPropertyType.validateValue(StructPropertyType.java:107)
	at org.eclipse.birt.report.model.metadata.PropertyDefn.doValidateValueWithExpression(PropertyDefn.java:905)
	at org.eclipse.birt.report.model.metadata.PropertyDefn.validateValue(PropertyDefn.java:872)
	at org.eclipse.birt.report.model.command.PropertyCommand.validateValue(PropertyCommand.java:857)
	at org.eclipse.birt.report.model.command.PropertyCommand.setProperty(PropertyCommand.java:257)
	at org.eclipse.birt.report.model.command.PropertyCommand.setProperty(PropertyCommand.java:134)
	at org.eclipse.birt.report.model.api.DesignElementHandle.setProperty(DesignElementHandle.java:520)
	at org.eclipse.birt.report.model.simpleapi.Label.addAction(Label.java:161)
	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.mozilla.javascript.MemberBox.invoke(MemberBox.java:160)
	... 76 more
Comment 1 Rick Lu CLA 2010-05-24 01:58:10 EDT
Fixed in 2.6.0 BRANCH.
Comment 2 Xiaoying Gu CLA 2010-05-25 05:47:44 EDT
verified in 2.6.0.v20100525-1629