Scripted DataSet problems [message #643440] |
Mon, 06 December 2010 21:03 |
Jim Garrison Messages: 57 Registered: July 2009 |
Member |
|
|
I've implemented a trivial scripted dataset sample where the Java object returns a small set of hardcoded test data. The report works and displays the table of data.
However, when I run it under "Run/Debug Report" I see a number of what look like critical exceptions:
>>>> Compiled Source:
function __bm_OPEN() {
lDao = new Packages.com.troux.licensing.dao.LicensingDao();
iter = lDao.getDummyEvents().iterator();
}
>>>> end compilation.
>>>> Compiled Source:
__bm_OPEN()
>>>> end compilation.
>>>> Frame Source Name:
>>>> Frame Function Name: __bm_OPEN
>>>> Enter script. 1
>>>> Line changed to: 1
>>>> Debugger exception occured:
>>>> Exit script.
org.mozilla.javascript.EcmaError: TypeError: [JavaPackage com.troux.licensing.dao.LicensingDao] is not a function, it is object. (#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3660)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3679)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3734)
at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3722)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3363)
at script.__bm_OPEN(:1)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.SecurityController$1.exec(SecurityController.java:193)
at org.eclipse.birt.report.engine.javascript.ScriptUtil$1.execWithDomain(ScriptUtil.java:59)
at org.mozilla.javascript.SecurityController.callWithDomain(SecurityController.java:189)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2474)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3330)
at script()
lots more of the same
And later...
>>>> Compiled Source:
function __bm_FETCH() {
if (!iter.hasNext()) return false;
var data = iter.next();
row["month"] = data.getMonth();
row["day"] = data.getDay();
row["maxSessions"] = data.getMaxSessions();
return true;
}
>>>> end compilation.
>>>> Compiled Source:
__bm_FETCH()
>>>> end compilation.
>>>> Frame Source Name:
>>>> Frame Function Name: __bm_FETCH
>>>> Enter script. 1
>>>> Line changed to: 1
>>>> Debugger exception occured:
>>>> Exit script.
org.mozilla.javascript.EcmaError: ReferenceError: "iter" is not defined. (#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3717)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1758)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1697)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3410)
at script.__bm_FETCH(:1)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.SecurityController$1.exec(SecurityController.java:193)
at org.eclipse.birt.report.engine.javascript.ScriptUtil$1.execWithDomain(ScriptUtil.java:59)
at org.mozilla.javascript.SecurityController.callWithDomain(SecurityController.java:189)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2474)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3330)
at script()
In spite of the exceptions, the report is correcly populated.
Is this a problem in the debugger, or in my code (which seems to work for this trivial case)?
[Updated on: Mon, 06 December 2010 21:12] Report message to a moderator
|
|
|
Re: Scripted DataSet problems [message #643446 is a reply to message #643440] |
Mon, 06 December 2010 21:20 |
|
Jim
Change
lDao = new Packages.com.troux.licensing.dao.LicensingDao();
to
importPackage(Packages.com.troux.licensing.dao);
lDao = new LicensingDao();
Jason
On 12/6/2010 4:03 PM, Jim Garrison wrote:
> I've implemented a trivial scripted dataset sample where the Java object
> returns a small set of hardcoded test data. The report works and
> displays the table of data.
>
> However, when I run it under "Run/Debug Report" I see a number of what
> look like critical exceptions:
>
>
>>>>> Compiled Source:
> function __bm_OPEN() {
> lDao = new Packages.com.troux.licensing.dao.LicensingDao();
> iter = lDao.getDummyEvents().iterator();
>
> }
>>>>> end compilation.
>>>>> Compiled Source:
> __bm_OPEN()
>>>>> end compilation.
>>>>> Frame Source Name: Frame Function Name: __bm_OPEN
>>>>> Enter script. 1
>>>>> Line changed to: 1
>>>>> Debugger exception occured:
>>>>> Exit script.
> org.mozilla.javascript.EcmaError: TypeError: [JavaPackage
> com.troux.licensing.dao.LicensingDao] is not a function, it is object. (#1)
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3654)
>
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3632)
>
> at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime .java:3660)
> at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntim e.java:3679)
> at
> org.mozilla.javascript.ScriptRuntime.notFunctionError(Script Runtime.java:3734)
>
> at
> org.mozilla.javascript.ScriptRuntime.notFunctionError(Script Runtime.java:3722)
>
> at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter .java:3363)
> at script.__bm_OPEN(:1)
> at org.mozilla.javascript.Interpreter.interpret(Interpreter.jav a:2487)
> at
> org.mozilla.javascript.InterpretedFunction.call(InterpretedF unction.java:164)
>
> at
> org.mozilla.javascript.SecurityController$1.exec(SecurityCon troller.java:193)
>
> at
> org.eclipse.birt.report.engine.javascript.ScriptUtil$1.execW ithDomain(ScriptUtil.java:59)
>
> at
> org.mozilla.javascript.SecurityController.callWithDomain(Sec urityController.java:189)
>
> at org.mozilla.javascript.Interpreter.interpret(Interpreter.jav a:2474)
> at
> org.mozilla.javascript.InterpretedFunction.call(InterpretedF unction.java:164)
>
> at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter .java:3330)
> at script()
>
> lots more of the same
>
>
> Is this a problem in the debugger, or in my code (which seems to work
> for this trivial case)?
>
|
|
|
|
Re: Scripted DataSet problems [message #643462 is a reply to message #643449] |
Mon, 06 December 2010 22:35 |
|
Where do you have LicensingDao defined (where is it located)?
Jason
On 12/6/2010 4:45 PM, Jim Garrison wrote:
> The report still works, but now the error is
>
>
> org.mozilla.javascript.EcmaError: ReferenceError: "LicensingDao" is not
> defined.
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04209 seconds