<p>Hi,</p><p> </p><p>We are on JBoss 7.2 and BIRT 4.3 and I'm seeing this exception, causing the RunReport task to fail. Everything is fine when we run the same report on a web-browser. So my guess is that there is something in the config that isnt set right. When running from the Browser we have the Run and Render task.</p><p> </p><p>Basically any and all Javascripts that we have in a .js file in the scriptlib file arent accessible by the BIRT engine. We want to run the same design file as part of a schedule and that is failing at the moment.</p><p> </p><p>I am not sure if I've put in all the details needed but any help here would be awesome:</p><p> </p><p>2014-01-29 21:05:56,635 WARNING [org.eclipse.birt.report.engine.script.internal.ScriptExecutor] (defaultThreadPool (Thread-108)) There are errors evaluating script "updateGeneratedBirtReportTable();":
ReferenceError: "updateGeneratedBirtReportTable" is not defined. (/report/method[
@name="beforeFactory"]#1): org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "updateGeneratedBirtReportTable();":
ReferenceError: "updateGeneratedBirtReportTable" is not defined. (/report/method[
@name="beforeFactory"]#1)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.addException(ScriptExecutor.java:249) [birt-runtime.jar:]
at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleBeforeFactory(ReportScriptExecutor.java:122) [birt-runtime.jar:]
at org.eclipse.birt.report.engine.api.impl.EngineTask.startFactory(EngineTask.java:2027) [birt-runtime.jar:]
at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:226) [birt-runtime.jar:]
at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:86) [birt-runtime.jar:]
at com.brocade.dcm.reports.birt.server.schedule.BIRTReportScheduleJob.runReport(BIRTReportScheduleJob.java:204) [classes:]
at com.brocade.dcm.reports.birt.server.schedule.BIRTReportScheduleJob.run(BIRTReportScheduleJob.java:95) [classes:]
at com.brocade.dcm.framework.jobexecutor.impl.CallableJob.call(CallableJob.java:264) [fw-jobexecutor.jar:]
at com.brocade.dcm.framework.concurrent.contract.runnable.CallableEnclosure.call(CallableEnclosure.java:171) [fw-concurrent.jar:]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: org.eclipse.birt.core.exception.CoreException: There are errors evaluating script "updateGeneratedBirtReportTable();":
ReferenceError: "updateGeneratedBirtReportTable" is not defined. (/report/method[
@name="beforeFactory"]#1)
at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:295) [birt-runtime.jar:]
at org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154) [birt-runtime.jar:]
at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:789) [birt-runtime.jar:]
at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:718) [birt-runtime.jar:]
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScriptInternal(ScriptExecutor.java:118) [birt-runtime.jar:]
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScript(ScriptExecutor.java:105) [birt-runtime.jar:]
at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleBeforeFactory(ReportScriptExecutor.java:114) [birt-runtime.jar:]
... 11 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "updateGeneratedBirtReportTable" is not defined. (/report/method[
@name="beforeFactory"]#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654) [js.jar:]
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632) [js.jar:]
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3717) [js.jar:]
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1758) [js.jar:]
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2135) [js.jar:]
at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:106) [js.jar:]
at org.mozilla.javascript.gen.c6._c0(/report/method[
@name="beforeFactory"]:1)
at org.mozilla.javascript.gen.c6.call(/report/method[
@name="beforeFactory"])
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398) [js.jar:]
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065) [js.jar:]
at org.mozilla.javascript.gen.c6.call(/report/method[
@name="beforeFactory"])
at org.mozilla.javascript.gen.c6.exec(/report/method[
@name="beforeFactory"])
at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:290) [birt-runtime.jar:]
... 17 more
</p><p> </p><p>This is the code that I'm using to setup the BIRT engine before the report gets executed through a schedule:</p><p> </p><p> config.setResourcePath("/");
config.setProperty(BIRTCommonConstants.BIRT_VIEWER_SCRIPTLIB_DIR, "");
config.setProperty(BIRTCommonConstants.BIRT_VIEWER_CONFIG_FILE, "WEB-INF/viewer.properties");
config.setProperty(BIRTCommonConstants.BIRT_RESOURCE_PATH, "");
config.setProperty(BIRTCommonConstants.BIRT_VIEWER_IMAGE_DIR, "");
config.setProperty(BIRTCommonConstants.BIRT_VIEWER_WORKING_FOLDER, "../../../../../../conf/birt-templates");
config.setProperty(BIRTCommonConstants.BIRT_VIEWER_DOCUMENT_FOLDER, "");
config.setProperty(BIRTCommonConstants.WORKING_FOLDER_ACCESS_ONLY, "false");
config.setProperty(BIRTCommonConstants.URL_REPORT_PATH_POLICY, "domain");
config.setProperty(BIRTCommonConstants.BIRT_VIEWER_LOG_DIR, "../../../../../../logs/server");
config.setProperty(BIRTCommonConstants.BIRT_VIEWER_LOG_LEVEL, "DEBUG");
config.setProperty(BIRTCommonConstants.BIRT_HOME, "");
config.setProperty(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, BIRTService.class.getClassLoader().toString());
config.setLogConfig("../../../../../../logs/server", Level.FINEST);
config.setLogFile("birtlogs.log");
config.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, BIRTService.class.getClassLoader().toString());
Platform.startup(config);</p>