Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Scripted Data Source
Scripted Data Source [message #202145] Tue, 21 November 2006 17:01 Go to next message
Eclipse UserFriend
Originally posted by: brad.lwsi.com

Hello,

I'm trying to get the scripted datasource example to work:
http://www.eclipse.org/birt/phoenix/examples/scripting/scrip teddatasource/

however, I am completely lost with how to actually take the java file and
compile it into a class file within eclipse.

Can someone provide a walk-through of how to set up a BIRT project (like
the scripted datasource example) in Eclipse so that I can recreate the
example above?

thanks!

Brad
Re: Scripted Data Source [message #202154 is a reply to message #202145] Tue, 21 November 2006 17:33 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Brad,

If you start Eclipse or BIRT allinone you should be able to select the
File->New Project and create a Java project.
If you have default settings adding or importing a Java class should
automatically be compiled.
You should then be able to open the Navigator View (Window->Show View) find
your .class file and export it ( right click export).

Jason

"brad" <brad@lwsi.com> wrote in message
news:22c2541b9c17926937fb776b4d1cc602$1@www.eclipse.org...
> Hello,
>
> I'm trying to get the scripted datasource example to work:
> http://www.eclipse.org/birt/phoenix/examples/scripting/scrip teddatasource/
>
> however, I am completely lost with how to actually take the java file and
> compile it into a class file within eclipse.
> Can someone provide a walk-through of how to set up a BIRT project (like
> the scripted datasource example) in Eclipse so that I can recreate the
> example above?
>
> thanks!
>
> Brad
>
Re: Scripted Data Source [message #202163 is a reply to message #202154] Tue, 21 November 2006 18:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brad.lwsi.com

I tried running that and then exporting the class file but got the same
message.

I exported to the WebViewerExample folder that I downloaded earlier and
then tried to run the example. All reports I've created and placed in that
folder seem are worked fine (datasets and reporting).

If I open the compiled class file in Eclipse I see the following:

Class File Editor

Source not found
There is no source file attached to the class file SimpleClass.class

public class SimpleClass {
public SimpleClass ();

public java.util.Vector readData();

public static void main(java.lang.String[] args);
}
Re: Scripted Data Source [message #202167 is a reply to message #202163] Tue, 21 November 2006 18:37 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Did you create a new Java project and import the Java code from the website?
Do you want me to send you the .class file?
Also try to put the .class file into the Scriptlib directory under the
WebViewer directory.

Jason

"brad" <brad@lwsi.com> wrote in message
news:82ac356f28a089dceb74cb02666ecb79$1@www.eclipse.org...
>I tried running that and then exporting the class file but got the same
>message.
> I exported to the WebViewerExample folder that I downloaded earlier and
> then tried to run the example. All reports I've created and placed in that
> folder seem are worked fine (datasets and reporting).
>
> If I open the compiled class file in Eclipse I see the following:
>
> Class File Editor
>
> Source not found
> There is no source file attached to the class file SimpleClass.class
>
> public class SimpleClass {
> public SimpleClass ();
>
> public java.util.Vector readData();
>
> public static void main(java.lang.String[] args);
> }
>
>
>
Re: Scripted Data Source [message #202169 is a reply to message #202167] Tue, 21 November 2006 18:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bgustavesen.lwsi.com

Yes, I created a brand new java project in eclipse. I have two folders in
there, "bin" which has the saved class file, and "src" which has the .java
file. Do I need other files/folders in the project directory? if so, what
are they?

If you could send the class file that would be great, but I definitely
need to be able to figure out how to build the class files.

I put the .class file that I created into the ScriptLib folder and got
this error when I ran the report in my browser:

The following items have errors:


Table (id = 110):
+ There are errors evaluating script "favoritesClass = new SimpleClass();
favorites = favoritesClass.readData();
totalrows = favorites.size();
currentrow = 0;".
Error.ScriptEvaluationError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are
errors evaluating script "favoritesClass = new SimpleClass();favorites =
favoritesClass.readData();totalrows = favorites.size();currentrow = 0;".
at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:76)
at
org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
at
org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:6 6)
at
org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open( ScriptDataSetRuntime.java:68)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.j ava:233)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :209)
at
org.eclipse.birt.data.engine.impl.QueryExecutor.execute(Quer yExecutor.java:735)
at
org.eclipse.birt.data.engine.impl.ServiceForQueryResults.exe cuteQuery(ServiceForQueryResults.java:181)
at
org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:137)
at
org.eclipse.birt.report.engine.data.dte.DteResultSet.<init>(DteResultSet.java:86)
at
org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:115)
at
org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:208)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.exe cuteQuery(ExecutionContext.java:1640)
at
org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex ecuteQuery(QueryItemExecutor.java:62)
at
org.eclipse.birt.report.engine.executor.TableItemExecutor.ex ecute(TableItemExecutor.java:74)
at
org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:35)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout Children(HTMLPageLM.java:123)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:81)
at
org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:80)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:194)
at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
Source) at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
Source) at
org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(Unknown
Source) at
org.eclipse.birt.report.service.actionhandler.BirtRunAndRend erActionHandler.__execute(Unknown
Source) at
org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(Unknown
Source) at
org.eclipse.birt.report.presentation.aggregation.layout.Engi neFragment.doService(Unknown
Source) at
org.eclipse.birt.report.presentation.aggregation.AbstractBas eFragment.service(Unknown
Source) at
org.eclipse.birt.report.servlet.BirtEngineServlet.__doGet(Un known Source)
at org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGe t(Unknown
Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11Connection Handler.processConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Poo lTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.ru n(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)Caused by:
org.eclipse.birt.data.engine.core.DataException: A BIRT exception
occurred: Error evaluating Javascript expression. Script engine error:
ReferenceError: "SimpleClass" is not defined. (DataSet[Fvr].__bm_OPEN#2)
Script source: DataSet[Fvr].__bm_OPEN, line: 1, text:__bm_OPEN(). See next
exception for more information.Error evaluating Javascript expression.
Script engine error: ReferenceError: "SimpleClass" is not defined.
(DataSet[Fvr].__bm_OPEN#2) Script source: DataSet[Fvr].__bm_OPEN, line: 1,
text:__bm_OPEN() at
org.eclipse.birt.data.engine.core.DataException.wrap(DataExc eption.java:118)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:552)
at
org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
... 45 moreCaused by: org.eclipse.birt.core.exception.CoreException: Error
evaluating Javascript expression. Script engine error: ReferenceError:
"SimpleClass" is not defined. (DataSet[Fvr].__bm_OPEN#2) Script source:
DataSet[Fvr].__bm_OPEN, line: 1, text:__bm_OPEN() at
org.eclipse.birt.core.script.JavascriptEvalUtil.wrapRhinoExc eption(JavascriptEvalUtil.java:281)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:105)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:137)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:548)
... 47 moreCaused by: org.mozilla.javascript.EcmaError: ReferenceError:
"SimpleClass" is not defined. (DataSet[Fvr].__bm_OPEN#2) at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3240)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3230)
at
org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRun time.java:3303)
at
org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRu ntime.java:1632)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java :1571) at
org.mozilla.javascript.gen.c63._c1(DataSet[Fvr].__bm_OPEN:2) at
org.mozilla.javascript.gen.c63.call(DataSet[Fvr].__bm_OPEN) at
org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
at
org.mozilla.javascript.gen.c20._c0(DataSet[setEnvironmentVar s].__bm_OPEN:1)
at
org.mozilla.javascript.gen.c20.call(DataSet[setEnvironmentVa rs].__bm_OPEN)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
at
org.mozilla.javascript.gen.c20.call(DataSet[setEnvironmentVa rs].__bm_OPEN)
at
org.mozilla.javascript.gen.c20.exec(DataSet[setEnvironmentVa rs].__bm_OPEN)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:98)
... 49 more
+ There are errors evaluating script "if( currentrow >= totalrows ) {
return( false );
}

var favrow = favorites.get(currentrow);

var Customer = favrow[0];
var Favorite = favrow[1];
var Color = favrow[2];

row["Customer"] = Customer;
row["Favorite"] = Favorite;
row["Color"] = Color;
currentrow = currentrow + 1;

return ( true );".
Error.ScriptEvaluationError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are
errors evaluating script "if( currentrow >= totalrows ) { return( false
);}var favrow = favorites.get(currentrow);var Customer = favrow[0];var
Favorite = favrow[1];var Color = favrow[2];row["Customer"] =
Customer;row["Favorite"] = Favorite;row["Color"] = Color;currentrow =
currentrow + 1;return ( true );". at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:76)
at
org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
at
org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleFetch(ScriptDataSetScriptExecutor.java: 100)
at
org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.fetch (ScriptDataSetRuntime.java:84)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.fetch(PreparedScriptDSQuery. java:246)
at
org.eclipse.birt.data.engine.executor.cache.OdiAdapter.fetch (OdiAdapter.java:148)
at
org.eclipse.birt.data.engine.executor.cache.RowResultSet.nex t(RowResultSet.java:91)
at
org.eclipse.birt.data.engine.executor.cache.ExpandableRowRes ultSet.next(ExpandableRowResultSet.java:62)
at
org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper .populateData(SmartCacheHelper.java:268)
at
org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper .initInstance(SmartCacheHelper.java:243)
at
org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper .getResultSetCache(SmartCacheHelper.java:206)
at
org.eclipse.birt.data.engine.executor.cache.SmartCache.<init >(SmartCache.java:65)
at
org.eclipse.birt.data.engine.executor.transform.pass.PassUti l.populateOdiResultSet(PassUtil.java:109)
at
org.eclipse.birt.data.engine.executor.transform.pass.PassUti l.pass(PassUtil.java:65)
at
org.eclipse.birt.data.engine.executor.transform.pass.PassMan ager.doSinglePass(PassManager.java:120)
at
org.eclipse.birt.data.engine.executor.transform.pass.PassMan ager.pass(PassManager.java:80)
at
org.eclipse.birt.data.engine.executor.transform.pass.PassMan ager.populateResultSet(PassManager.java:62)
at
org.eclipse.birt.data.engine.executor.transform.ResultSetPop ulator.populateResultSet(ResultSetPopulator.java:207)
at
org.eclipse.birt.data.engine.executor.transform.CachedResult Set. <init>(CachedResultSet.java:118)
at
org.eclipse.birt.data.engine.executor.CandidateQuery.execute (CandidateQuery.java:88)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :212)
at
org.eclipse.birt.data.engine.impl.QueryExecutor.execute(Quer yExecutor.java:735)
at
org.eclipse.birt.data.engine.impl.ServiceForQueryResults.exe cuteQuery(ServiceForQueryResults.java:181)
at
org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:137)
at
org.eclipse.birt.report.engine.data.dte.DteResultSet.<init>(DteResultSet.java:86)
at
org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:115)
at
org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:208)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.exe cuteQuery(ExecutionContext.java:1640)
at
org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex ecuteQuery(QueryItemExecutor.java:62)
at
org.eclipse.birt.report.engine.executor.TableItemExecutor.ex ecute(TableItemExecutor.java:74)
at
org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:35)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout Children(HTMLPageLM.java:123)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:81)
at
org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:80)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:194)
at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
Source) at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
Source) at
org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(Unknown
Source) at
org.eclipse.birt.report.service.actionhandler.BirtRunAndRend erActionHandler.__execute(Unknown
Source) at
org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(Unknown
Source) at
org.eclipse.birt.report.presentation.aggregation.layout.Engi neFragment.doService(Unknown
Source) at
org.eclipse.birt.report.presentation.aggregation.AbstractBas eFragment.service(Unknown
Source) at
org.eclipse.birt.report.servlet.BirtEngineServlet.__doGet(Un known Source)
at org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGe t(Unknown
Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11Connection Handler.processConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Poo lTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.ru n(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)Caused by:
org.eclipse.birt.data.engine.core.DataException: A BIRT exception
occurred: Error evaluating Javascript expression. Script engine error:
ReferenceError: "currentrow" is not defined. (DataSet[Fvr].__bm_FETCH#2)
Script source: DataSet[Fvr].__bm_FETCH, line: 1, text:__bm_FETCH(). See
next exception for more information.Error evaluating Javascript
expression. Script engine error: ReferenceError: "currentrow" is not
defined. (DataSet[Fvr].__bm_FETCH#2) Script source:
DataSet[Fvr].__bm_FETCH, line: 1, text:__bm_FETCH() at
org.eclipse.birt.data.engine.core.DataException.wrap(DataExc eption.java:118)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:552)
at
org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
... 60 moreCaused by: org.eclipse.birt.core.exception.CoreException: Error
evaluating Javascript expression. Script engine error: ReferenceError:
"currentrow" is not defined. (DataSet[Fvr].__bm_FETCH#2) Script source:
DataSet[Fvr].__bm_FETCH, line: 1, text:__bm_FETCH() at
org.eclipse.birt.core.script.JavascriptEvalUtil.wrapRhinoExc eption(JavascriptEvalUtil.java:281)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:105)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:137)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:548)
... 62 moreCaused by: org.mozilla.javascript.EcmaError: ReferenceError:
"currentrow" is not defined. (DataSet[Fvr].__bm_FETCH#2) at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3240)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3230)
at
org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRun time.java:3303)
at
org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRu ntime.java:1632)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java :1571) at
org.mozilla.javascript.gen.c64._c1(DataSet[Fvr].__bm_FETCH:2 ) at
org.mozilla.javascript.gen.c64.call(DataSet[Fvr].__bm_FETCH) at
org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
at
org.mozilla.javascript.gen.c22._c0(DataSet[setEnvironmentVar s].__bm_FETCH:1)
at
org.mozilla.javascript.gen.c22.call(DataSet[setEnvironmentVa rs].__bm_FETCH)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
at
org.mozilla.javascript.gen.c22.call(DataSet[setEnvironmentVa rs].__bm_FETCH)
at
org.mozilla.javascript.gen.c22.exec(DataSet[setEnvironmentVa rs].__bm_FETCH)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:98)
... 64 more
+ Unhandled exception when executing script
Re: Scripted Data Source [message #202170 is a reply to message #202167] Tue, 21 November 2006 19:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bgustavesen.lwsi.com

Jason,

Would it be make more sense or could it be done to send the java project
to me? thanks!
Re: Scripted Data Source [message #202230 is a reply to message #202145] Tue, 21 November 2006 22:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johnw.innoventsolutions.com

Brad,

I wrote an article similar to this, but uses a Java class to hit a web
service and uses it as a scripted data source. Let me know if it helps.

http://digiassn.blogspot.com/2006/10/birt-scripted-data-sour ce-to-call-web.html


brad wrote:
> Hello,
>
> I'm trying to get the scripted datasource example to work:
> http://www.eclipse.org/birt/phoenix/examples/scripting/scrip teddatasource/
>
> however, I am completely lost with how to actually take the java file
> and compile it into a class file within eclipse.
> Can someone provide a walk-through of how to set up a BIRT project (like
> the scripted datasource example) in Eclipse so that I can recreate the
> example above?
>
> thanks!
>
> Brad
>
Re: Scripted Data Source [message #202243 is a reply to message #202230] Tue, 21 November 2006 20:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bgustavesen.lwsi.com

Thanks John. I found your article earlier today when searching.

I still think that the main issue is how to set up the java project, build
the class file and then run it.
Re: Scripted Data Source [message #202295 is a reply to message #202243] Wed, 22 November 2006 02:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johnw.innoventsolutions.com

Brad,

Steps to create Java project:
-switch perspective over to Java(default)
-File/New project
-Select Java Project
-Name your project, specify your JRE, click next
-Include necessary libraries and click finish
-Go to file/new/class
-Make sure your class is under your project, name your class, include
main functions (not necessary, but useful for debugging) (Note: I did
not include a package. I left the package name blank).
-Write your Java code.
For example, I wrote this simple class to demonstrate, under a Project
called TestProject, no package name, and a class called Test:

public class Test {

/**
* @param args
*/
public String getName()
{
return "Test";
}

public static void main(String[] args) {
// TODO Auto-generated method stub
Test t = new Test();

System.out.println(t.getName());

}

}


-Save your class, and do a test run by Right-Mouse clicking on your
TestProject in the navigator, going to Run-as, and choosing the correct
run type. (I had to go into the run... under Run-as, double-click on
Java application, and following the wizard to get the correct starter
class and other options).
-Once run, your program should be compiled. If you do not have "build
automatically" checked under your project menu, you can choose
Project/Build-all.
-Open the BIRT Perspective
-Create a new report project, new report.
-I copied the file "C:\eclipse\workspace\TEstProject\test.class" to
the same folder as my new Report Project.
-Exit and restart Eclipse
-Open the Data Sources, select Scripted Data Source, and select new Data
Set, choose your new Data Source as the Data Source.
-Create a new column (I created a new column called name of type string).
-Under the Open method for the scripted datasource, I created the following:
x = 0;
obj = Packages.Test();

-Under the fetch method, I created the following code:
if (x == 0)
{
row["name"] = obj.getName();

x++;
return true;
}
else
return false;

-Then I go back into the Layout, drag the data set over to the designer
window, and run. I get the results "Test" entered as the value of name
under my data table.

Hope this helps Brad.
John


Brad wrote:
> Thanks John. I found your article earlier today when searching.
> I still think that the main issue is how to set up the java project,
> build the class file and then run it.
>
Re: Scripted Data Source [message #202418 is a reply to message #202243] Wed, 22 November 2006 14:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

Brad,
Eclipse automatically compiles the file (unless you turn it off). I
was looking at your previous posts and it looks like you have the Java
project setup properly. If you open the .java and edit it and save it
.... a new .class will be created.

Then follow Johns directions in his article. Just make sure to put
..class files in the birt\WEB-INF\classes directory with the appropriate
package paths and put all jars in the birt\WEB-INF\lib


Mark

Brad wrote:
> Thanks John. I found your article earlier today when searching.
> I still think that the main issue is how to set up the java project,
> build the class file and then run it.
>
Re: Scripted Data Source [message #202426 is a reply to message #202418] Wed, 22 November 2006 15:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bgustavesen.lwsi.com

I was able to get the sample working so that when I preview the report
design in Eclipse, it pulls the data from the .class file.

However, when I copy over the files into the WebViewerExample, I get the
same error as yesterday with the . So I have as the directory stucture...

*mywebroot*/WebViewerExample/example.rptdesign
*mywebroot*/WebViewerExample/WEB-INF
*mywebroot*/WebViewerExample/webcontent
*mywebroot*/WebViewerExample/scriptlib
*mywebroot*/WebViewerExample/report

Should I be able to just copy over the files? If so, where do I paste them
in?

thanks for everyones help.




error from yesterday / today in the webviewerxample:


The following items have errors:


Table (id = 110):
+ There are errors evaluating script "favoritesClass = new
Packages.SimpleClass();
favorites = favoritesClass.readData();
totalrows = favorites.size();
currentrow = 0;".
Error.ScriptEvaluationError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are
errors evaluating script "favoritesClass = new
Packages.SimpleClass();favorites = favoritesClass.readData();totalrows =
favorites.size();currentrow = 0;". at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:76)
at
org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
at
org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:6 6)
at
org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open( ScriptDataSetRuntime.java:68)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.j ava:233)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :209)
at
org.eclipse.birt.data.engine.impl.QueryExecutor.execute(Quer yExecutor.java:735)
at
org.eclipse.birt.data.engine.impl.ServiceForQueryResults.exe cuteQuery(ServiceForQueryResults.java:181)
at
org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:137)
at
org.eclipse.birt.report.engine.data.dte.DteResultSet.<init>(DteResultSet.java:86)
at
org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:115)
at
org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:208)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.exe cuteQuery(ExecutionContext.java:1640)
at
org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex ecuteQuery(QueryItemExecutor.java:62)
at
org.eclipse.birt.report.engine.executor.TableItemExecutor.ex ecute(TableItemExecutor.java:74)
at
org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:35)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout Children(HTMLPageLM.java:123)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:81)
at
org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:80)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:194)
at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
Source) at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
Source) at
org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(Unknown
Source) at
org.eclipse.birt.report.service.actionhandler.BirtRunAndRend erActionHandler.__execute(Unknown
Source) at
org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(Unknown
Source) at
org.eclipse.birt.report.presentation.aggregation.layout.Engi neFragment.doService(Unknown
Source) at
org.eclipse.birt.report.presentation.aggregation.AbstractBas eFragment.service(Unknown
Source) at
org.eclipse.birt.report.servlet.BirtEngineServlet.__doGet(Un known Source)
at org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGe t(Unknown
Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11Connection Handler.processConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Poo lTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.ru n(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)Caused by:
org.eclipse.birt.data.engine.core.DataException: A BIRT exception
occurred: Error evaluating Javascript expression. Script engine error:
TypeError: [JavaPackage SimpleClass] is not a function.
(DataSet[Fvr].__bm_OPEN#2) Script source: DataSet[Fvr].__bm_OPEN, line: 1,
text:__bm_OPEN(). See next exception for more information.Error evaluating
Javascript expression. Script engine error: TypeError: [JavaPackage
SimpleClass] is not a function. (DataSet[Fvr].__bm_OPEN#2) Script source:
DataSet[Fvr].__bm_OPEN, line: 1, text:__bm_OPEN() at
org.eclipse.birt.data.engine.core.DataException.wrap(DataExc eption.java:118)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:552)
at
org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
... 45 moreCaused by: org.eclipse.birt.core.exception.CoreException: Error
evaluating Javascript expression. Script engine error: TypeError:
[JavaPackage SimpleClass] is not a function. (DataSet[Fvr].__bm_OPEN#2)
Script source: DataSet[Fvr].__bm_OPEN, line: 1, text:__bm_OPEN() at
org.eclipse.birt.core.script.JavascriptEvalUtil.wrapRhinoExc eption(JavascriptEvalUtil.java:281)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:105)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:137)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:548)
... 47 moreCaused by: org.mozilla.javascript.EcmaError: TypeError:
[JavaPackage SimpleClass] is not a function. (DataSet[Fvr].__bm_OPEN#2) at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3240)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3230)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime .java:3246)
at
org.mozilla.javascript.ScriptRuntime.typeError1(ScriptRuntim e.java:3258)
at
org.mozilla.javascript.ScriptRuntime.notFunctionError(Script Runtime.java:3317)
at
org.mozilla.javascript.ScriptRuntime.notFunctionError(Script Runtime.java:3308)
at org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime .java:2057)
at org.mozilla.javascript.gen.c38._c1(DataSet[Fvr].__bm_OPEN:2) at
org.mozilla.javascript.gen.c38.call(DataSet[Fvr].__bm_OPEN) at
org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
at org.mozilla.javascript.gen.c39._c0(DataSet[Fvr].__bm_OPEN:1) at
org.mozilla.javascript.gen.c39.call(DataSet[Fvr].__bm_OPEN) at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
at org.mozilla.javascript.gen.c39.call(DataSet[Fvr].__bm_OPEN) at
org.mozilla.javascript.gen.c39.exec(DataSet[Fvr].__bm_OPEN) at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:98)
... 49 more
+ There are errors evaluating script "if( currentrow >= totalrows ) {
return( false );
}

var favrow = favorites.get(currentrow);

var Customer = favrow[0];
var Favorite = favrow[1];
var Color = favrow[2];

row["Customer"] = Customer;
row["Favorite"] = Favorite;
row["Color"] = Color;
currentrow = currentrow + 1;

return ( true );".
Error.ScriptEvaluationError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are
errors evaluating script "if( currentrow >= totalrows ) { return( false
);}var favrow = favorites.get(currentrow);var Customer = favrow[0];var
Favorite = favrow[1];var Color = favrow[2];row["Customer"] =
Customer;row["Favorite"] = Favorite;row["Color"] = Color;currentrow =
currentrow + 1;return ( true );". at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:76)
at
org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
at
org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleFetch(ScriptDataSetScriptExecutor.java: 100)
at
org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.fetch (ScriptDataSetRuntime.java:84)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.fetch(PreparedScriptDSQuery. java:246)
at
org.eclipse.birt.data.engine.executor.cache.OdiAdapter.fetch (OdiAdapter.java:148)
at
org.eclipse.birt.data.engine.executor.cache.RowResultSet.nex t(RowResultSet.java:91)
at
org.eclipse.birt.data.engine.executor.cache.ExpandableRowRes ultSet.next(ExpandableRowResultSet.java:62)
at
org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper .populateData(SmartCacheHelper.java:268)
at
org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper .initInstance(SmartCacheHelper.java:243)
at
org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper .getResultSetCache(SmartCacheHelper.java:206)
at
org.eclipse.birt.data.engine.executor.cache.SmartCache.<init >(SmartCache.java:65)
at
org.eclipse.birt.data.engine.executor.transform.pass.PassUti l.populateOdiResultSet(PassUtil.java:109)
at
org.eclipse.birt.data.engine.executor.transform.pass.PassUti l.pass(PassUtil.java:65)
at
org.eclipse.birt.data.engine.executor.transform.pass.PassMan ager.doSinglePass(PassManager.java:120)
at
org.eclipse.birt.data.engine.executor.transform.pass.PassMan ager.pass(PassManager.java:80)
at
org.eclipse.birt.data.engine.executor.transform.pass.PassMan ager.populateResultSet(PassManager.java:62)
at
org.eclipse.birt.data.engine.executor.transform.ResultSetPop ulator.populateResultSet(ResultSetPopulator.java:207)
at
org.eclipse.birt.data.engine.executor.transform.CachedResult Set. <init>(CachedResultSet.java:118)
at
org.eclipse.birt.data.engine.executor.CandidateQuery.execute (CandidateQuery.java:88)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :212)
at
org.eclipse.birt.data.engine.impl.QueryExecutor.execute(Quer yExecutor.java:735)
at
org.eclipse.birt.data.engine.impl.ServiceForQueryResults.exe cuteQuery(ServiceForQueryResults.java:181)
at
org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:137)
at
org.eclipse.birt.report.engine.data.dte.DteResultSet.<init>(DteResultSet.java:86)
at
org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:115)
at
org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:208)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.exe cuteQuery(ExecutionContext.java:1640)
at
org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex ecuteQuery(QueryItemExecutor.java:62)
at
org.eclipse.birt.report.engine.executor.TableItemExecutor.ex ecute(TableItemExecutor.java:74)
at
org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:35)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout Children(HTMLPageLM.java:123)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:81)
at
org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:80)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:194)
at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
Source) at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
Source) at
org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(Unknown
Source) at
org.eclipse.birt.report.service.actionhandler.BirtRunAndRend erActionHandler.__execute(Unknown
Source) at
org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(Unknown
Source) at
org.eclipse.birt.report.presentation.aggregation.layout.Engi neFragment.doService(Unknown
Source) at
org.eclipse.birt.report.presentation.aggregation.AbstractBas eFragment.service(Unknown
Source) at
org.eclipse.birt.report.servlet.BirtEngineServlet.__doGet(Un known Source)
at org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGe t(Unknown
Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11Connection Handler.processConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Poo lTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.ru n(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)Caused by:
org.eclipse.birt.data.engine.core.DataException: A BIRT exception
occurred: Error evaluating Javascript expression. Script engine error:
ReferenceError: "currentrow" is not defined. (DataSet[Fvr].__bm_FETCH#2)
Script source: DataSet[Fvr].__bm_FETCH, line: 1, text:__bm_FETCH(). See
next exception for more information.Error evaluating Javascript
expression. Script engine error: ReferenceError: "currentrow" is not
defined. (DataSet[Fvr].__bm_FETCH#2) Script source:
DataSet[Fvr].__bm_FETCH, line: 1, text:__bm_FETCH() at
org.eclipse.birt.data.engine.core.DataException.wrap(DataExc eption.java:118)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:552)
at
org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
... 60 moreCaused by: org.eclipse.birt.core.exception.CoreException: Error
evaluating Javascript expression. Script engine error: ReferenceError:
"currentrow" is not defined. (DataSet[Fvr].__bm_FETCH#2) Script source:
DataSet[Fvr].__bm_FETCH, line: 1, text:__bm_FETCH() at
org.eclipse.birt.core.script.JavascriptEvalUtil.wrapRhinoExc eption(JavascriptEvalUtil.java:281)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:105)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:137)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:548)
... 62 moreCaused by: org.mozilla.javascript.EcmaError: ReferenceError:
"currentrow" is not defined. (DataSet[Fvr].__bm_FETCH#2) at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3240)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3230)
at
org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRun time.java:3303)
at
org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRu ntime.java:1632)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java :1571) at
org.mozilla.javascript.gen.c40._c1(DataSet[Fvr].__bm_FETCH:2 ) at
org.mozilla.javascript.gen.c40.call(DataSet[Fvr].__bm_FETCH) at
org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
at org.mozilla.javascript.gen.c41._c0(DataSet[Fvr].__bm_FETCH:1 ) at
org.mozilla.javascript.gen.c41.call(DataSet[Fvr].__bm_FETCH) at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
at org.mozilla.javascript.gen.c41.call(DataSet[Fvr].__bm_FETCH) at
org.mozilla.javascript.gen.c41.exec(DataSet[Fvr].__bm_FETCH) at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:98)
... 64 more
+ Unhandled exception when executing script
Re: Scripted Data Source [message #202543 is a reply to message #202426] Wed, 22 November 2006 21:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johnw.innoventsolutions.com

Brad,

I didn't try to deploy to an app server. I tried it and came up with the
same error. Here is how I corrected it:

-Copied *.rptdesign to my %APACHE_ROOT%\webapps\birt folder
-Copied the Test.class file to %APACHE_ROOT%\WEBAPPS\birt\scriptlib folder.
-tried to run my report (which gave an error).
-Checked the configuration under %birt_home%\webinf (web.xml,
web-template.xml) and found that BIRT is indeed expecting the files
under scriptlib, changed log level to FINE
-As a hunch, the config files say specifically "*.JAR" files, so I went
into the scriptlib folder and made a .JAR file with the following
command: (assuming Test.class is the only class file in that directory)
C:\Program Files\Java\jdk1.5.0_09\bin\jar -cf Test.jar *.class

-Restarted Apache
-Re-ran the report. It worked. That fixed the problem.

John

brad wrote:
> I was able to get the sample working so that when I preview the report
> design in Eclipse, it pulls the data from the .class file.
> However, when I copy over the files into the WebViewerExample, I get the
> same error as yesterday with the . So I have as the directory stucture...
>
> *mywebroot*/WebViewerExample/example.rptdesign
> *mywebroot*/WebViewerExample/WEB-INF
> *mywebroot*/WebViewerExample/webcontent
> *mywebroot*/WebViewerExample/scriptlib
> *mywebroot*/WebViewerExample/report
>
> Should I be able to just copy over the files? If so, where do I paste
> them in?
>
> thanks for everyones help.
>
>
>
>
> error from yesterday / today in the webviewerxample:
>
>
> The following items have errors:
>
> Table (id = 110): + There are errors evaluating script "favoritesClass =
> new Packages.SimpleClass();
> favorites = favoritesClass.readData();
> totalrows = favorites.size();
> currentrow = 0;". Error.ScriptEvaluationError ( 1 time(s) )
> detail : org.eclipse.birt.report.engine.api.EngineException: There are
> errors evaluating script "favoritesClass = new
> Packages.SimpleClass();favorites = favoritesClass.readData();totalrows =
> favorites.size();currentrow = 0;". at
> org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:76)
> at
> org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
> at
> org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:6 6)
> at
> org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open( ScriptDataSetRuntime.java:68)
> at
> org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.j ava:233)
> at
> org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :209)
> at
> org.eclipse.birt.data.engine.impl.QueryExecutor.execute(Quer yExecutor.java:735)
> at
> org.eclipse.birt.data.engine.impl.ServiceForQueryResults.exe cuteQuery(ServiceForQueryResults.java:181)
> at
> org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:137)
> at
> org.eclipse.birt.report.engine.data.dte.DteResultSet.<init>(DteResultSet.java:86)
> at
> org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:115)
> at
> org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:208)
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.exe cuteQuery(ExecutionContext.java:1640)
> at
> org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex ecuteQuery(QueryItemExecutor.java:62)
> at
> org.eclipse.birt.report.engine.executor.TableItemExecutor.ex ecute(TableItemExecutor.java:74)
> at
> org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:35)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout Children(HTMLPageLM.java:123)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:81)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:80)
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:194)
> at
> org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
> Source) at
> org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
> Source) at
> org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(Unknown
> Source) at
> org.eclipse.birt.report.service.actionhandler.BirtRunAndRend erActionHandler.__execute(Unknown
> Source) at
> org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(Unknown
> Source) at
> org.eclipse.birt.report.presentation.aggregation.layout.Engi neFragment.doService(Unknown
> Source) at
> org.eclipse.birt.report.presentation.aggregation.AbstractBas eFragment.service(Unknown
> Source) at
> org.eclipse.birt.report.servlet.BirtEngineServlet.__doGet(Un known
> Source) at
> org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGe t(Unknown
> Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> at
> org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:252)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:173)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:213)
> at
> org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:178)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:126)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:105)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:107)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:148)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:869)
> at
> org.apache.coyote.http11.Http11BaseProtocol$Http11Connection Handler.processConnection(Http11BaseProtocol.java:664)
> at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Poo lTcpEndpoint.java:527)
> at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java:80)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.ru n(ThreadPool.java:684)
> at java.lang.Thread.run(Thread.java:595)Caused by:
> org.eclipse.birt.data.engine.core.DataException: A BIRT exception
> occurred: Error evaluating Javascript expression. Script engine error:
> TypeError: [JavaPackage SimpleClass] is not a function.
> (DataSet[Fvr].__bm_OPEN#2) Script source: DataSet[Fvr].__bm_OPEN, line:
> 1, text:__bm_OPEN(). See next exception for more information.Error
> evaluating Javascript expression. Script engine error: TypeError:
> [JavaPackage SimpleClass] is not a function. (DataSet[Fvr].__bm_OPEN#2)
> Script source: DataSet[Fvr].__bm_OPEN, line: 1, text:__bm_OPEN() at
> org.eclipse.birt.data.engine.core.DataException.wrap(DataExc eption.java:118)
> at
> org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:552)
> at
> org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
> at
> org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
> .. 45 moreCaused by: org.eclipse.birt.core.exception.CoreException:
> Error evaluating Javascript expression. Script engine error: TypeError:
> [JavaPackage SimpleClass] is not a function. (DataSet[Fvr].__bm_OPEN#2)
> Script source: DataSet[Fvr].__bm_OPEN, line: 1, text:__bm_OPEN() at
> org.eclipse.birt.core.script.JavascriptEvalUtil.wrapRhinoExc eption(JavascriptEvalUtil.java:281)
> at
> org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:105)
> at
> org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:137)
> at
> org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:548)
> .. 47 moreCaused by: org.mozilla.javascript.EcmaError: TypeError:
> [JavaPackage SimpleClass] is not a function. (DataSet[Fvr].__bm_OPEN#2)
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3240)
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3230)
> at
> org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime .java:3246)
> at
> org.mozilla.javascript.ScriptRuntime.typeError1(ScriptRuntim e.java:3258)
> at
> org.mozilla.javascript.ScriptRuntime.notFunctionError(Script Runtime.java:3317)
> at
> org.mozilla.javascript.ScriptRuntime.notFunctionError(Script Runtime.java:3308)
> at
> org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime .java:2057)
> at org.mozilla.javascript.gen.c38._c1(DataSet[Fvr].__bm_OPEN:2) at
> org.mozilla.javascript.gen.c38.call(DataSet[Fvr].__bm_OPEN) at
> org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
> at org.mozilla.javascript.gen.c39._c0(DataSet[Fvr].__bm_OPEN:1) at
> org.mozilla.javascript.gen.c39.call(DataSet[Fvr].__bm_OPEN) at
> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
> at
> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
> at org.mozilla.javascript.gen.c39.call(DataSet[Fvr].__bm_OPEN) at
> org.mozilla.javascript.gen.c39.exec(DataSet[Fvr].__bm_OPEN) at
> org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:98)
> .. 49 more
> + There are errors evaluating script "if(
> currentrow >= totalrows ) {
> return( false );
> }
>
> var favrow = favorites.get(currentrow);
>
> var Customer = favrow[0];
> var Favorite = favrow[1];
> var Color = favrow[2];
>
> row["Customer"] = Customer;
> row["Favorite"] = Favorite;
> row["Color"] = Color;
> currentrow = currentrow + 1;
>
> return ( true );". Error.ScriptEvaluationError ( 1 time(s) )
> detail : org.eclipse.birt.report.engine.api.EngineException: There are
> errors evaluating script "if( currentrow >= totalrows ) { return( false
> );}var favrow = favorites.get(currentrow);var Customer = favrow[0];var
> Favorite = favrow[1];var Color = favrow[2];row["Customer"] =
> Customer;row["Favorite"] = Favorite;row["Color"] = Color;currentrow =
> currentrow + 1;return ( true );". at
> org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:76)
> at
> org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
> at
> org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleFetch(ScriptDataSetScriptExecutor.java: 100)
> at
> org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.fetch (ScriptDataSetRuntime.java:84)
> at
> org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.fetch(PreparedScriptDSQuery. java:246)
> at
> org.eclipse.birt.data.engine.executor.cache.OdiAdapter.fetch (OdiAdapter.java:148)
> at
> org.eclipse.birt.data.engine.executor.cache.RowResultSet.nex t(RowResultSet.java:91)
> at
> org.eclipse.birt.data.engine.executor.cache.ExpandableRowRes ultSet.next(ExpandableRowResultSet.java:62)
> at
> org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper .populateData(SmartCacheHelper.java:268)
> at
> org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper .initInstance(SmartCacheHelper.java:243)
> at
> org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper .getResultSetCache(SmartCacheHelper.java:206)
> at
> org.eclipse.birt.data.engine.executor.cache.SmartCache.<init >(SmartCache.java:65)
> at
> org.eclipse.birt.data.engine.executor.transform.pass.PassUti l.populateOdiResultSet(PassUtil.java:109)
> at
> org.eclipse.birt.data.engine.executor.transform.pass.PassUti l.pass(PassUtil.java:65)
> at
> org.eclipse.birt.data.engine.executor.transform.pass.PassMan ager.doSinglePass(PassManager.java:120)
> at
> org.eclipse.birt.data.engine.executor.transform.pass.PassMan ager.pass(PassManager.java:80)
> at
> org.eclipse.birt.data.engine.executor.transform.pass.PassMan ager.populateResultSet(PassManager.java:62)
> at
> org.eclipse.birt.data.engine.executor.transform.ResultSetPop ulator.populateResultSet(ResultSetPopulator.java:207)
> at
> org.eclipse.birt.data.engine.executor.transform.CachedResult Set. <init>(CachedResultSet.java:118)
> at
> org.eclipse.birt.data.engine.executor.CandidateQuery.execute (CandidateQuery.java:88)
> at
> org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :212)
> at
> org.eclipse.birt.data.engine.impl.QueryExecutor.execute(Quer yExecutor.java:735)
> at
> org.eclipse.birt.data.engine.impl.ServiceForQueryResults.exe cuteQuery(ServiceForQueryResults.java:181)
> at
> org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:137)
> at
> org.eclipse.birt.report.engine.data.dte.DteResultSet.<init>(DteResultSet.java:86)
> at
> org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:115)
> at
> org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:208)
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.exe cuteQuery(ExecutionContext.java:1640)
> at
> org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex ecuteQuery(QueryItemExecutor.java:62)
> at
> org.eclipse.birt.report.engine.executor.TableItemExecutor.ex ecute(TableItemExecutor.java:74)
> at
> org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:35)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout Children(HTMLPageLM.java:123)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:81)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:80)
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:194)
> at
> org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
> Source) at
> org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
> Source) at
> org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(Unknown
> Source) at
> org.eclipse.birt.report.service.actionhandler.BirtRunAndRend erActionHandler.__execute(Unknown
> Source) at
> org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(Unknown
> Source) at
> org.eclipse.birt.report.presentation.aggregation.layout.Engi neFragment.doService(Unknown
> Source) at
> org.eclipse.birt.report.presentation.aggregation.AbstractBas eFragment.service(Unknown
> Source) at
> org.eclipse.birt.report.servlet.BirtEngineServlet.__doGet(Un known
> Source) at
> org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGe t(Unknown
> Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> at
> org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:252)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:173)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:213)
> at
> org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:178)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:126)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:105)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:107)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:148)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:869)
> at
> org.apache.coyote.http11.Http11BaseProtocol$Http11Connection Handler.processConnection(Http11BaseProtocol.java:664)
> at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Poo lTcpEndpoint.java:527)
> at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java:80)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.ru n(ThreadPool.java:684)
> at java.lang.Thread.run(Thread.java:595)Caused by:
> org.eclipse.birt.data.engine.core.DataException: A BIRT exception
> occurred: Error evaluating Javascript expression. Script engine error:
> ReferenceError: "currentrow" is not defined. (DataSet[Fvr].__bm_FETCH#2)
> Script source: DataSet[Fvr].__bm_FETCH, line: 1, text:__bm_FETCH(). See
> next exception for more information.Error evaluating Javascript
> expression. Script engine error: ReferenceError: "currentrow" is not
> defined. (DataSet[Fvr].__bm_FETCH#2) Script source:
> DataSet[Fvr].__bm_FETCH, line: 1, text:__bm_FETCH() at
> org.eclipse.birt.data.engine.core.DataException.wrap(DataExc eption.java:118)
> at
> org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:552)
> at
> org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
> at
> org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
> .. 60 moreCaused by: org.eclipse.birt.core.exception.CoreException:
> Error evaluating Javascript expression. Script engine error:
> ReferenceError: "currentrow" is not defined. (DataSet[Fvr].__bm_FETCH#2)
> Script source: DataSet[Fvr].__bm_FETCH, line: 1, text:__bm_FETCH() at
> org.eclipse.birt.core.script.JavascriptEvalUtil.wrapRhinoExc eption(JavascriptEvalUtil.java:281)
> at
> org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:105)
> at
> org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:137)
> at
> org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:548)
> .. 62 moreCaused by: org.mozilla.javascript.EcmaError: ReferenceError:
> "currentrow" is not defined. (DataSet[Fvr].__bm_FETCH#2) at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3240)
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3230)
> at
> org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRun time.java:3303)
> at
> org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRu ntime.java:1632)
> at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java :1571) at
> org.mozilla.javascript.gen.c40._c1(DataSet[Fvr].__bm_FETCH:2 ) at
> org.mozilla.javascript.gen.c40.call(DataSet[Fvr].__bm_FETCH) at
> org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
> at org.mozilla.javascript.gen.c41._c0(DataSet[Fvr].__bm_FETCH:1 ) at
> org.mozilla.javascript.gen.c41.call(DataSet[Fvr].__bm_FETCH) at
> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
> at
> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
> at org.mozilla.javascript.gen.c41.call(DataSet[Fvr].__bm_FETCH) at
> org.mozilla.javascript.gen.c41.exec(DataSet[Fvr].__bm_FETCH) at
> org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:98)
> .. 64 more
> + Unhandled exception when executing script
Re: Scripted Data Source [message #202551 is a reply to message #202543] Wed, 22 November 2006 20:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bgustavesen.lwsi.com

John,

Actually, I just got it to work by doing the following:

1. copy the .class file or folder to:
WebViewerExample\WEB-INF\classes

2. restarted Tomcat. ran the report and it worked.

I've tested with a couple different class files now and they all seem to
work.
Re: Scripted Data Source [message #202566 is a reply to message #202551] Wed, 22 November 2006 23:02 Go to previous message
Eclipse UserFriend
Originally posted by: johnw.innoventsolutions.com

Interesting. I was only able to get it to work by converting to a jar
file. I will try the classes folder (which doesn't exist, need to
create) and go from there.

Brad wrote:
> John,
>
> Actually, I just got it to work by doing the following:
>
> 1. copy the .class file or folder to:
> WebViewerExample\WEB-INF\classes
>
> 2. restarted Tomcat. ran the report and it worked.
> I've tested with a couple different class files now and they all seem to
> work.
>
>
>
Previous Topic:Making report show multiple screens/pages
Next Topic:report.service.api.ReportServiceException??
Goto Forum:
  


Current Time: Sun Oct 20 07:41:08 GMT 2024

Powered by FUDForum. Page generated in 0.04877 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top