Skip to main content



      Home
Home » Archived » BIRT » Calling Java classes from Report Designs fails...(with errors)
Calling Java classes from Report Designs fails...(with errors) [message #257724] Tue, 09 October 2007 17:33 Go to next message
Eclipse UserFriend
Originally posted by: kumolu.us.ibm.com

I am trying to call some Java classes that are not part of the core Java
API. It works fine in the designer having added the 2 jars that contain my
referenced classes but on deploying my reports to eWAS (the App Server we
are using), it stops working. This is regardless of the fact that the
classes in my jars are actually loaded on starting the WAS Server. I have
also attempted to move my jars to my Web App's lib dir and eWAS lib dir
including placing the .class files in WEB-INF/classes but all to no avail.
Here is the code that I have:


<method
name="initialize"><![CDATA[//reportContext.setPersistentGlobalVariable( "buildDate",
"tetet");
appContext = reportContext.getAppContext();
importPackage(Packages.com.ibm.tivoli.reporting.util)
rptVersion = new ReportingVersion();
appContext.put("MyReportingVersion", rptVersion);
appContext = reportContext.getAppContext();
myObject = appContext.get("MyReportingVersion");
bldDate=myObject.getBuildDate()
reportContext.setPersistentGlobalVariable("buildDate",
bldDate);]]></method>

And here is the point at which I am trying to display the text: <text
name="TCR Environment 1 Value" id="10003937">
<property name="marginTop">0pt</property>
<property name="paddingTop">1pt</property>
<property name="canShrink">false</property>
<method
name="onRender"><![CDATA[reportContext.getPersistentGlobalVariable( "buildDate");]]></method>
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate");</VALUE-OF>]]></text-property>
</text>

This was after failing at just making a direct call to my class's method
thus:
<text-property
name="content"><![CDATA[<VALUE-OF> Packages.com.ibm.tivoli.reporting.util.ReportingVersion.getB uildDate(); </VALUE-OF>]]></text-property>

Here is a copy of the exception thrown in the Server log:

[10/9/07 16:42:17:031 EDT] 00000018 impl W
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler
runAndRenderReport(UserContext,Report,Map,RenderReportOption sLocal)
CTGTRE042W An error [ reference id = REPORTID_1_OBJECTID_55f455f4 ]
occurred attempting to run and format the report [
/TivoliProducts/TCR/Overview ] with design [
/TivoliProducts/TCR/TCRInfrastructure.rptdesign ] . The error message
received from the report engine is [ There are errors evaluating script
"//reportContext.setPersistentGlobalVariable("buildDate", "tetet");
appContext = reportContext.getAppContext();
importPackage(Packages.com.ibm.tivoli.reporting.util)
rptVersion = new ReportingVersion();
appContext.put("MyReportingVersion", rptVersion);
appContext = reportContext.getAppContext();
myObject = appContext.get("MyReportingVersion");
bldDate=myObject.getBuildDate()
reportContext.setPersistentGlobalVariable("buildDate", bldDate);":{1}. ]
The report was generated, but may be incompleted.
[10/9/07 16:42:18:750 EDT] 00000018 ReportEngine E ReferenceError:
"ReportingVersion" is not defined. (<inline>#4)
org.mozilla.javascript.EcmaError:
ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
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.name(ScriptRuntime.java :1566)
at org.mozilla.javascript.gen.c69._c0(<inline>:4)
at org.mozilla.javascript.gen.c69.call(<inline>)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
at org.mozilla.javascript.gen.c69.call(<inline>)
at org.mozilla.javascript.gen.c69.exec(<inline>)
at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
at
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
at
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
at
org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
at
org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
at
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
at
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
at
com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
at
com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
at
com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
Source)
at
com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
at
com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
at
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
at
com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)

Any ideas, pls? Thank you very much in advance!
Re: Calling Java classes from Report Designs fails...(with errors) [message #257786 is a reply to message #257724] Wed, 10 October 2007 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Dare,

If you have the classes in a jar in the Viewer web-inf/lib this should
work. Where did you put the jars at when working in the designer?
Also can you write a dummy class and call it just to verify that it is
not another dependency that is causing the issue?

Jason

Dare Kumolu-Johnson wrote:
> I am trying to call some Java classes that are not part of the core Java
> API. It works fine in the designer having added the 2 jars that contain
> my referenced classes but on deploying my reports to eWAS (the App
> Server we are using), it stops working. This is regardless of the fact
> that the classes in my jars are actually loaded on starting the WAS
> Server. I have also attempted to move my jars to my Web App's lib dir
> and eWAS lib dir including placing the .class files in WEB-INF/classes
> but all to no avail. Here is the code that I have:
>
>
> <method
> name="initialize"><![CDATA[//reportContext.setPersistentGlobalVariable( "buildDate",
> "tetet");
> appContext = reportContext.getAppContext();
> importPackage(Packages.com.ibm.tivoli.reporting.util)
> rptVersion = new ReportingVersion();
> appContext.put("MyReportingVersion", rptVersion);
> appContext = reportContext.getAppContext();
> myObject = appContext.get("MyReportingVersion");
> bldDate=myObject.getBuildDate()
> reportContext.setPersistentGlobalVariable("buildDate",
> bldDate);]]></method>
>
> And here is the point at which I am trying to display the text: <text
> name="TCR Environment 1 Value" id="10003937">
> <property name="marginTop">0pt</property>
> <property name="paddingTop">1pt</property>
> <property name="canShrink">false</property>
> <method
> name="onRender"><![CDATA[reportContext.getPersistentGlobalVariable( "buildDate");]]></method>
>
> <property name="contentType">html</property>
> <text-property
> name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate");</VALUE-OF>]]></text-property>
>
> </text>
>
> This was after failing at just making a direct call to my class's method
> thus:
> <text-property
> name="content"><![CDATA[<VALUE-OF> Packages.com.ibm.tivoli.reporting.util.ReportingVersion.getB uildDate(); </VALUE-OF>]]></text-property>
>
>
> Here is a copy of the exception thrown in the Server log:
>
> [10/9/07 16:42:17:031 EDT] 00000018 impl W
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler
> runAndRenderReport(UserContext,Report,Map,RenderReportOption sLocal)
> CTGTRE042W An error [ reference id = REPORTID_1_OBJECTID_55f455f4 ]
> occurred attempting to run and format the report [
> /TivoliProducts/TCR/Overview ] with design [
> /TivoliProducts/TCR/TCRInfrastructure.rptdesign ] . The error message
> received from the report engine is [ There are errors evaluating script
> "//reportContext.setPersistentGlobalVariable("buildDate", "tetet");
> appContext = reportContext.getAppContext();
> importPackage(Packages.com.ibm.tivoli.reporting.util)
> rptVersion = new ReportingVersion();
> appContext.put("MyReportingVersion", rptVersion);
> appContext = reportContext.getAppContext();
> myObject = appContext.get("MyReportingVersion");
> bldDate=myObject.getBuildDate()
> reportContext.setPersistentGlobalVariable("buildDate", bldDate);":{1}. ]
> The report was generated, but may be incompleted.
> [10/9/07 16:42:18:750 EDT] 00000018 ReportEngine E ReferenceError:
> "ReportingVersion" is not defined. (<inline>#4)
> org.mozilla.javascript.EcmaError:
> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
> 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.name(ScriptRuntime.java :1566)
> at org.mozilla.javascript.gen.c69._c0(<inline>:4)
> at org.mozilla.javascript.gen.c69.call(<inline>)
> at
> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
> at
> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
> at org.mozilla.javascript.gen.c69.call(<inline>)
> at org.mozilla.javascript.gen.c69.exec(<inline>)
> at
> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>
> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>
> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>
> at
> org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>
> at
> org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>
> at
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>
> at
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>
> at
> com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>
> at
> com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>
> at
> com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
> Source)
> at
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>
> at
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>
> at
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>
> at
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>
> at
> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
> at
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>
> at
> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>
> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>
> at
> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>
> at
> com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>
> at
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>
> at
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>
> at
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>
> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
> at
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>
> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>
> Any ideas, pls? Thank you very much in advance!
>
Re: Calling Java classes from Report Designs fails...(with errors) [message #257814 is a reply to message #257786] Wed, 10 October 2007 11:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kumolu.us.ibm.com

Jason Weathersby wrote:

> Dare,

> If you have the classes in a jar in the Viewer web-inf/lib this should
> work. Where did you put the jars at when working in the designer?
> Also can you write a dummy class and call it just to verify that it is
> not another dependency that is causing the issue?

> Jason

> Dare Kumolu-Johnson wrote:
>> I am trying to call some Java classes that are not part of the core Java
>> API. It works fine in the designer having added the 2 jars that contain
>> my referenced classes but on deploying my reports to eWAS (the App
>> Server we are using), it stops working. This is regardless of the fact
>> that the classes in my jars are actually loaded on starting the WAS
>> Server. I have also attempted to move my jars to my Web App's lib dir
>> and eWAS lib dir including placing the .class files in WEB-INF/classes
>> but all to no avail. Here is the code that I have:
>>
>>
>> <method
>>
name="initialize"><![CDATA[//reportContext.setPersistentGlobalVariable( "buildDate",
>> "tetet");
>> appContext = reportContext.getAppContext();
>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>> rptVersion = new ReportingVersion();
>> appContext.put("MyReportingVersion", rptVersion);
>> appContext = reportContext.getAppContext();
>> myObject = appContext.get("MyReportingVersion");
>> bldDate=myObject.getBuildDate()
>> reportContext.setPersistentGlobalVariable("buildDate",
>> bldDate);]]></method>
>>
>> And here is the point at which I am trying to display the text: <text
>> name="TCR Environment 1 Value" id="10003937">
>> <property name="marginTop">0pt</property>
>> <property name="paddingTop">1pt</property>
>> <property name="canShrink">false</property>
>> <method
>>
name="onRender"><![CDATA[reportContext.getPersistentGlobalVariable( "buildDate");]]></method>
>>
>> <property name="contentType">html</property>
>> <text-property
>>
name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate");</VALUE-OF>]]></text-property>
>>
>> </text>
>>
>> This was after failing at just making a direct call to my class's method
>> thus:
>> <text-property
>>
name="content"><![CDATA[<VALUE-OF> Packages.com.ibm.tivoli.reporting.util.ReportingVersion.getB uildDate(); </VALUE-OF>]]></text-property>
>>
>>
>> Here is a copy of the exception thrown in the Server log:
>>
>> [10/9/07 16:42:17:031 EDT] 00000018 impl W
>> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler
>> runAndRenderReport(UserContext,Report,Map,RenderReportOption sLocal)
>> CTGTRE042W An error [ reference id = REPORTID_1_OBJECTID_55f455f4 ]
>> occurred attempting to run and format the report [
>> /TivoliProducts/TCR/Overview ] with design [
>> /TivoliProducts/TCR/TCRInfrastructure.rptdesign ] . The error message
>> received from the report engine is [ There are errors evaluating script
>> "//reportContext.setPersistentGlobalVariable("buildDate", "tetet");
>> appContext = reportContext.getAppContext();
>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>> rptVersion = new ReportingVersion();
>> appContext.put("MyReportingVersion", rptVersion);
>> appContext = reportContext.getAppContext();
>> myObject = appContext.get("MyReportingVersion");
>> bldDate=myObject.getBuildDate()
>> reportContext.setPersistentGlobalVariable("buildDate", bldDate);":{1}. ]
>> The report was generated, but may be incompleted.
>> [10/9/07 16:42:18:750 EDT] 00000018 ReportEngine E ReferenceError:
>> "ReportingVersion" is not defined. (<inline>#4)
>> org.mozilla.javascript.EcmaError:
>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>> 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.name(ScriptRuntime.java :1566)
>> at org.mozilla.javascript.gen.c69._c0(<inline>:4)
>> at org.mozilla.javascript.gen.c69.call(<inline>)
>> at
>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>> at
>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>> at org.mozilla.javascript.gen.c69.call(<inline>)
>> at org.mozilla.javascript.gen.c69.exec(<inline>)
>> at
>> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
>> at
>>
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>>
>> at
>>
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>>
>> at
>>
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>>
>> at
>>
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>>
>> at
>>
org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>>
>> at
>>
org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>>
>> at
>>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>>
>> at
>>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>>
>> at
>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>>
>> at
>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>>
>> at
>>
com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>>
>> at
>>
com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>>
>> at
>>
com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
>> Source)
>> at
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>>
>> at
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>> at
>>
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>>
>> at
>>
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>>
>> at
>>
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>>
>> at
>>
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>>
>> at
>> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
>> at
>>
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>>
>> at
>> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
>> at
>>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>>
>> at
>>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>>
>> at
>>
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>>
>> at
>>
com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>>
>> at
>>
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>>
>> at
>>
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>>
>> at
>>
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>>
>> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
>> at
>>
com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>>
>> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>>
>> Any ideas, pls? Thank you very much in advance!
>>
I tried the web-inf/lib and it failed on the Server. In the designer, I
added the jars to the project's build path and it worked fine.
Wrote a dummy class to call the same methods and print out the same
BuildDate that I am trying to print out and that worked fine but I
couldn't get it to show on the report on adding it to the Report Design
and deploying the application.
Re: Calling Java classes from Report Designs fails...(with errors) [message #257848 is a reply to message #257814] Wed, 10 October 2007 15:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Dare,

What error did you get in on the server with the dummy class?

Jason

Dare Kumolu-Johnson wrote:
> Jason Weathersby wrote:
>
>> Dare,
>
>> If you have the classes in a jar in the Viewer web-inf/lib this should
>> work. Where did you put the jars at when working in the designer?
>> Also can you write a dummy class and call it just to verify that it is
>> not another dependency that is causing the issue?
>
>> Jason
>
>> Dare Kumolu-Johnson wrote:
>>> I am trying to call some Java classes that are not part of the core
>>> Java API. It works fine in the designer having added the 2 jars that
>>> contain my referenced classes but on deploying my reports to eWAS
>>> (the App Server we are using), it stops working. This is regardless
>>> of the fact that the classes in my jars are actually loaded on
>>> starting the WAS Server. I have also attempted to move my jars to my
>>> Web App's lib dir and eWAS lib dir including placing the .class files
>>> in WEB-INF/classes but all to no avail. Here is the code that I have:
>>>
>>>
>>> <method
> name="initialize"><![CDATA[//reportContext.setPersistentGlobalVariable( "buildDate",
>
>>> "tetet");
>>> appContext = reportContext.getAppContext();
>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>> rptVersion = new ReportingVersion();
>>> appContext.put("MyReportingVersion", rptVersion);
>>> appContext = reportContext.getAppContext();
>>> myObject = appContext.get("MyReportingVersion");
>>> bldDate=myObject.getBuildDate()
>>> reportContext.setPersistentGlobalVariable("buildDate",
>>> bldDate);]]></method>
>>>
>>> And here is the point at which I am trying to display the text: <text
>>> name="TCR Environment 1 Value" id="10003937">
>>> <property name="marginTop">0pt</property>
>>> <property name="paddingTop">1pt</property>
>>> <property name="canShrink">false</property>
>>> <method
> name="onRender"><![CDATA[reportContext.getPersistentGlobalVariable( "buildDate");]]></method>
>
>>>
>>> <property name="contentType">html</property>
>>> <text-property
> name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate");</VALUE-OF>]]></text-property>
>
>>>
>>> </text>
>>>
>>> This was after failing at just making a direct call to my class's
>>> method thus:
>>> <text-property
> name="content"><![CDATA[<VALUE-OF> Packages.com.ibm.tivoli.reporting.util.ReportingVersion.getB uildDate(); </VALUE-OF>]]></text-property>
>
>>>
>>>
>>> Here is a copy of the exception thrown in the Server log:
>>>
>>> [10/9/07 16:42:17:031 EDT] 00000018 impl W
>>> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler
>>> runAndRenderReport(UserContext,Report,Map,RenderReportOption sLocal)
>>> CTGTRE042W An error [ reference id = REPORTID_1_OBJECTID_55f455f4 ]
>>> occurred attempting to run and format the report [
>>> /TivoliProducts/TCR/Overview ] with design [
>>> /TivoliProducts/TCR/TCRInfrastructure.rptdesign ] . The error message
>>> received from the report engine is [ There are errors evaluating
>>> script "//reportContext.setPersistentGlobalVariable("buildDate",
>>> "tetet");
>>> appContext = reportContext.getAppContext();
>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>> rptVersion = new ReportingVersion();
>>> appContext.put("MyReportingVersion", rptVersion);
>>> appContext = reportContext.getAppContext();
>>> myObject = appContext.get("MyReportingVersion");
>>> bldDate=myObject.getBuildDate()
>>> reportContext.setPersistentGlobalVariable("buildDate",
>>> bldDate);":{1}. ] The report was generated, but may be incompleted.
>>> [10/9/07 16:42:18:750 EDT] 00000018 ReportEngine E ReferenceError:
>>> "ReportingVersion" is not defined. (<inline>#4)
>>> org.mozilla.javascript.EcmaError:
>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>> 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.name(ScriptRuntime.java :1566)
>>> at org.mozilla.javascript.gen.c69._c0(<inline>:4)
>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>> at
>>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>> at
>>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>> at org.mozilla.javascript.gen.c69.exec(<inline>)
>>> at
>>> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
>>> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>
>>>
>>> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>
>>>
>>> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>
>>>
>>> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>
>>>
>>> at
> org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>
>>>
>>> at
> org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>
>>>
>>> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>
>>>
>>> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>
>>>
>>> at
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>
>>>
>>> at
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>
>>>
>>> at
> com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>
>>>
>>> at
> com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>
>>>
>>> at
> com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
>
>>> Source)
>>> at
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>
>>>
>>> at
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>
>>>
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>>> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>
>>>
>>> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>
>>>
>>> at
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>
>>>
>>> at
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>
>>>
>>> at
>>> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
>>>
>>> at
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>
>>>
>>> at
>>> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
>>>
>>> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>
>>>
>>> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>
>>>
>>> at
> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>
>>>
>>> at
> com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>
>>>
>>> at
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>
>>>
>>> at
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>
>>>
>>> at
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>
>>>
>>> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>>> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
>>> at
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>
>>>
>>> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>>>
>>> Any ideas, pls? Thank you very much in advance!
>>>
> I tried the web-inf/lib and it failed on the Server. In the designer, I
> added the jars to the project's build path and it worked fine.
> Wrote a dummy class to call the same methods and print out the same
> BuildDate that I am trying to print out and that worked fine but I
> couldn't get it to show on the report on adding it to the Report Design
> and deploying the application.
>
Re: Calling Java classes from Report Designs fails...(with errors) [message #257942 is a reply to message #257848] Thu, 11 October 2007 11:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kumolu.us.ibm.com

Jason Weathersby wrote:

> Dare,

> What error did you get in on the server with the dummy class?

> Jason

> Dare Kumolu-Johnson wrote:
>> Jason Weathersby wrote:
>>
>>> Dare,
>>
>>> If you have the classes in a jar in the Viewer web-inf/lib this should
>>> work. Where did you put the jars at when working in the designer?
>>> Also can you write a dummy class and call it just to verify that it is
>>> not another dependency that is causing the issue?
>>
>>> Jason
>>
>>> Dare Kumolu-Johnson wrote:
>>>> I am trying to call some Java classes that are not part of the core
>>>> Java API. It works fine in the designer having added the 2 jars that
>>>> contain my referenced classes but on deploying my reports to eWAS
>>>> (the App Server we are using), it stops working. This is regardless
>>>> of the fact that the classes in my jars are actually loaded on
>>>> starting the WAS Server. I have also attempted to move my jars to my
>>>> Web App's lib dir and eWAS lib dir including placing the .class files
>>>> in WEB-INF/classes but all to no avail. Here is the code that I have:
>>>>
>>>>
>>>> <method
>>
name="initialize"><![CDATA[//reportContext.setPersistentGlobalVariable( "buildDate",
>>
>>>> "tetet");
>>>> appContext = reportContext.getAppContext();
>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>> rptVersion = new ReportingVersion();
>>>> appContext.put("MyReportingVersion", rptVersion);
>>>> appContext = reportContext.getAppContext();
>>>> myObject = appContext.get("MyReportingVersion");
>>>> bldDate=myObject.getBuildDate()
>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>> bldDate);]]></method>
>>>>
>>>> And here is the point at which I am trying to display the text: <text
>>>> name="TCR Environment 1 Value" id="10003937">
>>>> <property name="marginTop">0pt</property>
>>>> <property name="paddingTop">1pt</property>
>>>> <property name="canShrink">false</property>
>>>> <method
>>
name="onRender"><![CDATA[reportContext.getPersistentGlobalVariable( "buildDate");]]></method>
>>
>>>>
>>>> <property name="contentType">html</property>
>>>> <text-property
>>
name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate");</VALUE-OF>]]></text-property>
>>
>>>>
>>>> </text>
>>>>
>>>> This was after failing at just making a direct call to my class's
>>>> method thus:
>>>> <text-property
>>
name="content"><![CDATA[<VALUE-OF> Packages.com.ibm.tivoli.reporting.util.ReportingVersion.getB uildDate(); </VALUE-OF>]]></text-property>
>>
>>>>
>>>>
>>>> Here is a copy of the exception thrown in the Server log:
>>>>
>>>> [10/9/07 16:42:17:031 EDT] 00000018 impl W
>>>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler
>>>> runAndRenderReport(UserContext,Report,Map,RenderReportOption sLocal)
>>>> CTGTRE042W An error [ reference id = REPORTID_1_OBJECTID_55f455f4 ]
>>>> occurred attempting to run and format the report [
>>>> /TivoliProducts/TCR/Overview ] with design [
>>>> /TivoliProducts/TCR/TCRInfrastructure.rptdesign ] . The error message
>>>> received from the report engine is [ There are errors evaluating
>>>> script "//reportContext.setPersistentGlobalVariable("buildDate",
>>>> "tetet");
>>>> appContext = reportContext.getAppContext();
>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>> rptVersion = new ReportingVersion();
>>>> appContext.put("MyReportingVersion", rptVersion);
>>>> appContext = reportContext.getAppContext();
>>>> myObject = appContext.get("MyReportingVersion");
>>>> bldDate=myObject.getBuildDate()
>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>> bldDate);":{1}. ] The report was generated, but may be incompleted.
>>>> [10/9/07 16:42:18:750 EDT] 00000018 ReportEngine E ReferenceError:
>>>> "ReportingVersion" is not defined. (<inline>#4)
>>>> org.mozilla.javascript.EcmaError:
>>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>>> 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.name(ScriptRuntime.java :1566)
>>>> at org.mozilla.javascript.gen.c69._c0(<inline>:4)
>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>> at
>>>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>>> at
>>>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>> at org.mozilla.javascript.gen.c69.exec(<inline>)
>>>> at
>>>> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
>>>> at
>>
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>>
>>>>
>>>> at
>>
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>>
>>>>
>>>> at
>>
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>>
>>>>
>>>> at
>>
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>>
>>>>
>>>> at
>>
org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>>
>>>>
>>>> at
>>
org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>>
>>>>
>>>> at
>>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>>
>>>>
>>>> at
>>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>>
>>>>
>>>> at
>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>>
>>>>
>>>> at
>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>>
>>>>
>>>> at
>>
com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>>
>>>>
>>>> at
>>
com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>>
>>>>
>>>> at
>>
com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
>>
>>>> Source)
>>>> at
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>>
>>>>
>>>> at
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>>
>>>>
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>>>> at
>>
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>>
>>>>
>>>> at
>>
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>>
>>>>
>>>> at
>>
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>>
>>>>
>>>> at
>>
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>>
>>>>
>>>> at
>>>> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
>>>>
>>>> at
>>
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>>
>>>>
>>>> at
>>>>
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
>>>>
>>>> at
>>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>>
>>>>
>>>> at
>>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>>
>>>>
>>>> at
>>
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>>
>>>>
>>>> at
>>
com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>>
>>>>
>>>> at
>>
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>>
>>>>
>>>> at
>>
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>>
>>>>
>>>> at
>>
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>>
>>>>
>>>> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>>>> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
>>>> at
>>
com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>>
>>>>
>>>> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>>>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>>>>
>>>> Any ideas, pls? Thank you very much in advance!
>>>>
>> I tried the web-inf/lib and it failed on the Server. In the designer, I
>> added the jars to the project's build path and it worked fine.
>> Wrote a dummy class to call the same methods and print out the same
>> BuildDate that I am trying to print out and that worked fine but I
>> couldn't get it to show on the report on adding it to the Report Design
>> and deploying the application.
>>
Didn't get any error with the dummy class.
Re: Calling Java classes from Report Designs fails...(with errors) [message #258071 is a reply to message #257942] Fri, 12 October 2007 10:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Dare,

So you got the dummy class to work in the Web-inf/lib?
If so, this most likely means your class is dependent on some other
class that is not in the web-inf/lib.

Jason


Dare Kumolu-Johnson wrote:
> Jason Weathersby wrote:
>
>> Dare,
>
>> What error did you get in on the server with the dummy class?
>
>> Jason
>
>> Dare Kumolu-Johnson wrote:
>>> Jason Weathersby wrote:
>>>
>>>> Dare,
>>>
>>>> If you have the classes in a jar in the Viewer web-inf/lib this
>>>> should work. Where did you put the jars at when working in the
>>>> designer?
>>>> Also can you write a dummy class and call it just to verify that it
>>>> is not another dependency that is causing the issue?
>>>
>>>> Jason
>>>
>>>> Dare Kumolu-Johnson wrote:
>>>>> I am trying to call some Java classes that are not part of the core
>>>>> Java API. It works fine in the designer having added the 2 jars
>>>>> that contain my referenced classes but on deploying my reports to
>>>>> eWAS (the App Server we are using), it stops working. This is
>>>>> regardless of the fact that the classes in my jars are actually
>>>>> loaded on starting the WAS Server. I have also attempted to move my
>>>>> jars to my Web App's lib dir and eWAS lib dir including placing the
>>>>> .class files in WEB-INF/classes but all to no avail. Here is the
>>>>> code that I have:
>>>>>
>>>>>
>>>>> <method
>>>
> name="initialize"><![CDATA[//reportContext.setPersistentGlobalVariable( "buildDate",
>
>>>
>>>>> "tetet");
>>>>> appContext = reportContext.getAppContext();
>>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>>> rptVersion = new ReportingVersion();
>>>>> appContext.put("MyReportingVersion", rptVersion);
>>>>> appContext = reportContext.getAppContext();
>>>>> myObject = appContext.get("MyReportingVersion");
>>>>> bldDate=myObject.getBuildDate()
>>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>>> bldDate);]]></method>
>>>>>
>>>>> And here is the point at which I am trying to display the text:
>>>>> <text name="TCR Environment 1 Value" id="10003937">
>>>>> <property name="marginTop">0pt</property>
>>>>> <property name="paddingTop">1pt</property>
>>>>> <property name="canShrink">false</property>
>>>>> <method
>>>
> name="onRender"><![CDATA[reportContext.getPersistentGlobalVariable( "buildDate");]]></method>
>
>>>
>>>>>
>>>>> <property name="contentType">html</property>
>>>>> <text-property
>>>
> name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate");</VALUE-OF>]]></text-property>
>
>>>
>>>>>
>>>>> </text>
>>>>>
>>>>> This was after failing at just making a direct call to my class's
>>>>> method thus:
>>>>> <text-property
>>>
> name="content"><![CDATA[<VALUE-OF> Packages.com.ibm.tivoli.reporting.util.ReportingVersion.getB uildDate(); </VALUE-OF>]]></text-property>
>
>>>
>>>>>
>>>>>
>>>>> Here is a copy of the exception thrown in the Server log:
>>>>>
>>>>> [10/9/07 16:42:17:031 EDT] 00000018 impl W
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler
>>>>> runAndRenderReport(UserContext,Report,Map,RenderReportOption sLocal)
>>>>> CTGTRE042W An error [ reference id = REPORTID_1_OBJECTID_55f455f4 ]
>>>>> occurred attempting to run and format the report [
>>>>> /TivoliProducts/TCR/Overview ] with design [
>>>>> /TivoliProducts/TCR/TCRInfrastructure.rptdesign ] . The error
>>>>> message received from the report engine is [ There are errors
>>>>> evaluating script
>>>>> "//reportContext.setPersistentGlobalVariable("buildDate", "tetet");
>>>>> appContext = reportContext.getAppContext();
>>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>>> rptVersion = new ReportingVersion();
>>>>> appContext.put("MyReportingVersion", rptVersion);
>>>>> appContext = reportContext.getAppContext();
>>>>> myObject = appContext.get("MyReportingVersion");
>>>>> bldDate=myObject.getBuildDate()
>>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>>> bldDate);":{1}. ] The report was generated, but may be incompleted.
>>>>> [10/9/07 16:42:18:750 EDT] 00000018 ReportEngine E
>>>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>>>> org.mozilla.javascript.EcmaError:
>>>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>>>> 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.name(ScriptRuntime.java :1566)
>>>>> at org.mozilla.javascript.gen.c69._c0(<inline>:4)
>>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>>> at
>>>>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>>>>
>>>>> at
>>>>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>>>>
>>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>>> at org.mozilla.javascript.gen.c69.exec(<inline>)
>>>>> at
>>>>> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
>>>>>
>>>>> at
>>>
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>
>>>
>>>>>
>>>>> at
>>>
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>
>>>
>>>>>
>>>>> at
>>>
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>
>>>
>>>>>
>>>>> at
>>>
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>
>>>
>>>>>
>>>>> at
>>>
> org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>
>>>
>>>>>
>>>>> at
>>>
> org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>
>>>
>>>>>
>>>>> at
>>>
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>
>>>
>>>>>
>>>>> at
>>>
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
>
>>>
>>>>> Source)
>>>>> at
>>>
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>
>>>
>>>>>
>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>>>>> at
>>>
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>
>>>
>>>>>
>>>>> at
>>>>> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
>>>>>
>>>>> at
>>>
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>
>>>
>>>>>
>>>>> at
> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
>>>>>
>>>>> at
>>>
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>
>>>
>>>>>
>>>>> at
>>>
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>
>>>
>>>>>
>>>>> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>>>>> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
>>>>> at
>>>
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>
>>>
>>>>>
>>>>> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>>>>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>>>>>
>>>>> Any ideas, pls? Thank you very much in advance!
>>>>>
>>> I tried the web-inf/lib and it failed on the Server. In the designer,
>>> I added the jars to the project's build path and it worked fine.
>>> Wrote a dummy class to call the same methods and print out the same
>>> BuildDate that I am trying to print out and that worked fine but I
>>> couldn't get it to show on the report on adding it to the Report
>>> Design and deploying the application.
>>>
> Didn't get any error with the dummy class.
Re: Calling Java classes from Report Designs fails...(with errors) [message #258144 is a reply to message #258071] Fri, 12 October 2007 14:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kumolu.us.ibm.com

Jason Weathersby wrote:

> Dare,

> So you got the dummy class to work in the Web-inf/lib?
> If so, this most likely means your class is dependent on some other
> class that is not in the web-inf/lib.

> Jason


> Dare Kumolu-Johnson wrote:
>> Jason Weathersby wrote:
>>
>>> Dare,
>>
>>> What error did you get in on the server with the dummy class?
>>
>>> Jason
>>
>>> Dare Kumolu-Johnson wrote:
>>>> Jason Weathersby wrote:
>>>>
>>>>> Dare,
>>>>
>>>>> If you have the classes in a jar in the Viewer web-inf/lib this
>>>>> should work. Where did you put the jars at when working in the
>>>>> designer?
>>>>> Also can you write a dummy class and call it just to verify that it
>>>>> is not another dependency that is causing the issue?
>>>>
>>>>> Jason
>>>>
>>>>> Dare Kumolu-Johnson wrote:
>>>>>> I am trying to call some Java classes that are not part of the core
>>>>>> Java API. It works fine in the designer having added the 2 jars
>>>>>> that contain my referenced classes but on deploying my reports to
>>>>>> eWAS (the App Server we are using), it stops working. This is
>>>>>> regardless of the fact that the classes in my jars are actually
>>>>>> loaded on starting the WAS Server. I have also attempted to move my
>>>>>> jars to my Web App's lib dir and eWAS lib dir including placing the
>>>>>> .class files in WEB-INF/classes but all to no avail. Here is the
>>>>>> code that I have:
>>>>>>
>>>>>>
>>>>>> <method
>>>>
>>
name="initialize"><![CDATA[//reportContext.setPersistentGlobalVariable( "buildDate",
>>
>>>>
>>>>>> "tetet");
>>>>>> appContext = reportContext.getAppContext();
>>>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>>>> rptVersion = new ReportingVersion();
>>>>>> appContext.put("MyReportingVersion", rptVersion);
>>>>>> appContext = reportContext.getAppContext();
>>>>>> myObject = appContext.get("MyReportingVersion");
>>>>>> bldDate=myObject.getBuildDate()
>>>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>>>> bldDate);]]></method>
>>>>>>
>>>>>> And here is the point at which I am trying to display the text:
>>>>>> <text name="TCR Environment 1 Value" id="10003937">
>>>>>> <property name="marginTop">0pt</property>
>>>>>> <property name="paddingTop">1pt</property>
>>>>>> <property name="canShrink">false</property>
>>>>>> <method
>>>>
>>
name="onRender"><![CDATA[reportContext.getPersistentGlobalVariable( "buildDate");]]></method>
>>
>>>>
>>>>>>
>>>>>> <property name="contentType">html</property>
>>>>>> <text-property
>>>>
>>
name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate");</VALUE-OF>]]></text-property>
>>
>>>>
>>>>>>
>>>>>> </text>
>>>>>>
>>>>>> This was after failing at just making a direct call to my class's
>>>>>> method thus:
>>>>>> <text-property
>>>>
>>
name="content"><![CDATA[<VALUE-OF> Packages.com.ibm.tivoli.reporting.util.ReportingVersion.getB uildDate(); </VALUE-OF>]]></text-property>
>>
>>>>
>>>>>>
>>>>>>
>>>>>> Here is a copy of the exception thrown in the Server log:
>>>>>>
>>>>>> [10/9/07 16:42:17:031 EDT] 00000018 impl W
>> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler
>>>>>> runAndRenderReport(UserContext,Report,Map,RenderReportOption sLocal)
>>>>>> CTGTRE042W An error [ reference id = REPORTID_1_OBJECTID_55f455f4 ]
>>>>>> occurred attempting to run and format the report [
>>>>>> /TivoliProducts/TCR/Overview ] with design [
>>>>>> /TivoliProducts/TCR/TCRInfrastructure.rptdesign ] . The error
>>>>>> message received from the report engine is [ There are errors
>>>>>> evaluating script
>>>>>> "//reportContext.setPersistentGlobalVariable("buildDate", "tetet");
>>>>>> appContext = reportContext.getAppContext();
>>>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>>>> rptVersion = new ReportingVersion();
>>>>>> appContext.put("MyReportingVersion", rptVersion);
>>>>>> appContext = reportContext.getAppContext();
>>>>>> myObject = appContext.get("MyReportingVersion");
>>>>>> bldDate=myObject.getBuildDate()
>>>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>>>> bldDate);":{1}. ] The report was generated, but may be incompleted.
>>>>>> [10/9/07 16:42:18:750 EDT] 00000018 ReportEngine E
>>>>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>>>>> org.mozilla.javascript.EcmaError:
>>>>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>>>>> 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.name(ScriptRuntime.java :1566)
>>>>>> at org.mozilla.javascript.gen.c69._c0(<inline>:4)
>>>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>>>> at
>>>>>>
org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>>>>>
>>>>>> at
>>>>>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>>>>>
>>>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>>>> at org.mozilla.javascript.gen.c69.exec(<inline>)
>>>>>> at
>>>>>> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
>>>>>>
>>>>>> at
>>>>
>>
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
>>
>>>>
>>>>>> Source)
>>>>>> at
>>>>
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>>
>>>>
>>>>>>
>>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>>>>>> at
>>>>
>>
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>>
>>>>
>>>>>>
>>>>>> at
>>>>>>
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>>
>>>>
>>>>>>
>>>>>> at
>> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>>
>>>>
>>>>>>
>>>>>> at
>>>>
>>
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>>
>>>>
>>>>>>
>>>>>> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>>>>>> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
>>>>>> at
>>>>
>>
com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>>
>>>>
>>>>>>
>>>>>> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>>>>>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>>>>>>
>>>>>> Any ideas, pls? Thank you very much in advance!
>>>>>>
>>>> I tried the web-inf/lib and it failed on the Server. In the designer,
>>>> I added the jars to the project's build path and it worked fine.
>>>> Wrote a dummy class to call the same methods and print out the same
>>>> BuildDate that I am trying to print out and that worked fine but I
>>>> couldn't get it to show on the report on adding it to the Report
>>>> Design and deploying the application.
>>>>
>> Didn't get any error with the dummy class.
Hi Jason -

I have tried different things and it still doesn't work. All the dependent
classes wre copied int oweb-inf/lib. I also tried adding the classes that
I am calling to the scriptapi.jar file in BIRT and repackaged it and it
was the same dead end. Pls here is my code:
<method name="initialize"><![CDATA[appContext =
reportContext.getAppContext();
importPackage(Packages.com.ibm.tivoli.reporting.util)
appContext.put("MyReportingVersion",
ReportingVersion.getBuildDate());
myObject = appContext.get("MyReportingVersion");
reportContext.setPersistentGlobalVariable("buildDate",
myObject);]]>
</method>

and I accessing it here:

<text-property
name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate")</VALUE-OF>]]></text-property>

The methods I am calling are static; I'm not sure if that could have any
implication.

Someone mentioned something about
engine.getConfig().getAppContext().put(EngineConstants.APPCO NTEXT_CLASSLOADER_KEY,
ReportEngine.class.getClassLoader()) on
https://bugs.eclipse.org/bugs/show_bug.cgi?id=186272. Could that apply to
this and if so, how do I incorporate that into the code I have above? Pls
can you help me look into this? Thanks in advance for your prompt reply.

The exception thrown is here:

[10/12/07 14:48:02:406 EDT] 0000001b ReportEngine E ReferenceError:
"ReportingVersion" is not defined. (<inline>#3)
org.mozilla.javascript.EcmaError:
ReferenceError: "ReportingVersion" is not defined. (<inline>#3)
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.name(ScriptRuntime.java :1566)
at org.mozilla.javascript.gen.c345._c0(<inline>:3)
at org.mozilla.javascript.gen.c345.call(<inline>)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
at org.mozilla.javascript.gen.c345.call(<inline>)
at org.mozilla.javascript.gen.c345.exec(<inline>)
at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
at
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
at
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
at
org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
at
org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
at
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
at
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
at
com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
at
com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
at
com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
Source)
at
com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
at
com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
at
com.ibm.tivoli.reporting.reportViewer.ReportViewer.doPost(Re portViewer.java:250)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
at
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
at
com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
Re: Calling Java classes from Report Designs fails...(with errors) [message #258425 is a reply to message #258144] Mon, 15 October 2007 14:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Dare,

The APPCONTEXT_CLASSLOADER_KEY is useful if you are writing your own web
app. The Web Viewer does this by default. This still looks like a
loader issue. Can you write a blank report and add a data element with
this expression?

importPackage(Packages.com.ibm.tivoli.reporting.util);
ReportingVersion.getBuildDate();

And then run it? Make sure the ReportingVersion and all required
classes are either in the ScriptLib or the web-inf/lib directory of the
Viwer.

Jason

Dare Kumolu-Johnson wrote:
> Jason Weathersby wrote:
>
>> Dare,
>
>> So you got the dummy class to work in the Web-inf/lib?
>> If so, this most likely means your class is dependent on some other
>> class that is not in the web-inf/lib.
>
>> Jason
>
>
>> Dare Kumolu-Johnson wrote:
>>> Jason Weathersby wrote:
>>>
>>>> Dare,
>>>
>>>> What error did you get in on the server with the dummy class?
>>>
>>>> Jason
>>>
>>>> Dare Kumolu-Johnson wrote:
>>>>> Jason Weathersby wrote:
>>>>>
>>>>>> Dare,
>>>>>
>>>>>> If you have the classes in a jar in the Viewer web-inf/lib this
>>>>>> should work. Where did you put the jars at when working in the
>>>>>> designer?
>>>>>> Also can you write a dummy class and call it just to verify that
>>>>>> it is not another dependency that is causing the issue?
>>>>>
>>>>>> Jason
>>>>>
>>>>>> Dare Kumolu-Johnson wrote:
>>>>>>> I am trying to call some Java classes that are not part of the
>>>>>>> core Java API. It works fine in the designer having added the 2
>>>>>>> jars that contain my referenced classes but on deploying my
>>>>>>> reports to eWAS (the App Server we are using), it stops working.
>>>>>>> This is regardless of the fact that the classes in my jars are
>>>>>>> actually loaded on starting the WAS Server. I have also attempted
>>>>>>> to move my jars to my Web App's lib dir and eWAS lib dir
>>>>>>> including placing the .class files in WEB-INF/classes but all to
>>>>>>> no avail. Here is the code that I have:
>>>>>>>
>>>>>>>
>>>>>>> <method
>>>>>
>>>
> name="initialize"><![CDATA[//reportContext.setPersistentGlobalVariable( "buildDate",
>
>>>
>>>>>
>>>>>>> "tetet");
>>>>>>> appContext = reportContext.getAppContext();
>>>>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>>>>> rptVersion = new ReportingVersion();
>>>>>>> appContext.put("MyReportingVersion", rptVersion);
>>>>>>> appContext = reportContext.getAppContext();
>>>>>>> myObject = appContext.get("MyReportingVersion");
>>>>>>> bldDate=myObject.getBuildDate()
>>>>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>>>>> bldDate);]]></method>
>>>>>>>
>>>>>>> And here is the point at which I am trying to display the text:
>>>>>>> <text name="TCR Environment 1 Value" id="10003937">
>>>>>>> <property name="marginTop">0pt</property>
>>>>>>> <property name="paddingTop">1pt</property>
>>>>>>> <property name="canShrink">false</property>
>>>>>>> <method
>>>>>
>>>
> name="onRender"><![CDATA[reportContext.getPersistentGlobalVariable( "buildDate");]]></method>
>
>>>
>>>>>
>>>>>>>
>>>>>>> <property name="contentType">html</property>
>>>>>>> <text-property
>>>>>
>>>
> name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate");</VALUE-OF>]]></text-property>
>
>>>
>>>>>
>>>>>>>
>>>>>>> </text>
>>>>>>>
>>>>>>> This was after failing at just making a direct call to my class's
>>>>>>> method thus:
>>>>>>> <text-property
>>>>>
>>>
> name="content"><![CDATA[<VALUE-OF> Packages.com.ibm.tivoli.reporting.util.ReportingVersion.getB uildDate(); </VALUE-OF>]]></text-property>
>
>>>
>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Here is a copy of the exception thrown in the Server log:
>>>>>>>
>>>>>>> [10/9/07 16:42:17:031 EDT] 00000018 impl W
>>> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler
>>>
>>>>>>> runAndRenderReport(UserContext,Report,Map,RenderReportOption sLocal)
>>>>>>> CTGTRE042W An error [ reference id = REPORTID_1_OBJECTID_55f455f4
>>>>>>> ] occurred attempting to run and format the report [
>>>>>>> /TivoliProducts/TCR/Overview ] with design [
>>>>>>> /TivoliProducts/TCR/TCRInfrastructure.rptdesign ] . The error
>>>>>>> message received from the report engine is [ There are errors
>>>>>>> evaluating script
>>>>>>> "//reportContext.setPersistentGlobalVariable("buildDate", "tetet");
>>>>>>> appContext = reportContext.getAppContext();
>>>>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>>>>> rptVersion = new ReportingVersion();
>>>>>>> appContext.put("MyReportingVersion", rptVersion);
>>>>>>> appContext = reportContext.getAppContext();
>>>>>>> myObject = appContext.get("MyReportingVersion");
>>>>>>> bldDate=myObject.getBuildDate()
>>>>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>>>>> bldDate);":{1}. ] The report was generated, but may be incompleted.
>>>>>>> [10/9/07 16:42:18:750 EDT] 00000018 ReportEngine E
>>>>>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>>>>>> org.mozilla.javascript.EcmaError:
>>>>>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>>>>>> 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.name(ScriptRuntime.java :1566)
>>>>>>> at org.mozilla.javascript.gen.c69._c0(<inline>:4)
>>>>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>>>>> at
> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>>>>>>
>>>>>>> at
>>>>>>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>>>>>>
>>>>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>>>>> at org.mozilla.javascript.gen.c69.exec(<inline>)
>>>>>>> at
>>>>>>> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
>>>>>>>
>>>>>>> at
>>>>>
>>>
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
>
>>>
>>>>>
>>>>>>> Source)
>>>>>>> at
>>>>>
>>>
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>>>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>>>>>>> at
>>>>>
>>>
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at
>>>>>
>>>
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>>>>>>> at
>>>>>>> com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
>>>>>>> at
>>>>>
>>>
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>
>>>
>>>>>
>>>>>>>
>>>>>>> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>>>>>>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>>>>>>>
>>>>>>> Any ideas, pls? Thank you very much in advance!
>>>>>>>
>>>>> I tried the web-inf/lib and it failed on the Server. In the
>>>>> designer, I added the jars to the project's build path and it
>>>>> worked fine.
>>>>> Wrote a dummy class to call the same methods and print out the same
>>>>> BuildDate that I am trying to print out and that worked fine but I
>>>>> couldn't get it to show on the report on adding it to the Report
>>>>> Design and deploying the application.
>>>>>
>>> Didn't get any error with the dummy class.
> Hi Jason -
>
> I have tried different things and it still doesn't work. All the
> dependent classes wre copied int oweb-inf/lib. I also tried adding the
> classes that I am calling to the scriptapi.jar file in BIRT and
> repackaged it and it was the same dead end. Pls here is my code:
> <method name="initialize"><![CDATA[appContext =
> reportContext.getAppContext();
>
> importPackage(Packages.com.ibm.tivoli.reporting.util)
> appContext.put("MyReportingVersion",
> ReportingVersion.getBuildDate());
> myObject = appContext.get("MyReportingVersion");
>
> reportContext.setPersistentGlobalVariable("buildDate", myObject);]]>
> </method>
> and I accessing it here:
>
> <text-property
> name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate")</VALUE-OF>]]></text-property>
>
>
> The methods I am calling are static; I'm not sure if that could have any
> implication.
> Someone mentioned something about
> engine.getConfig().getAppContext().put(EngineConstants.APPCO NTEXT_CLASSLOADER_KEY,
>
> ReportEngine.class.getClassLoader()) on
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=186272. Could that apply
> to this and if so, how do I incorporate that into the code I have above?
> Pls can you help me look into this? Thanks in advance for your prompt
> reply.
>
> The exception thrown is here:
>
> [10/12/07 14:48:02:406 EDT] 0000001b ReportEngine E ReferenceError:
> "ReportingVersion" is not defined. (<inline>#3)
> org.mozilla.javascript.EcmaError:
> ReferenceError: "ReportingVersion" is not defined. (<inline>#3)
> 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.name(ScriptRuntime.java :1566)
> at org.mozilla.javascript.gen.c345._c0(<inline>:3)
> at org.mozilla.javascript.gen.c345.call(<inline>)
> at
> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
> at
> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
> at org.mozilla.javascript.gen.c345.call(<inline>)
> at org.mozilla.javascript.gen.c345.exec(<inline>)
> at
> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>
> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>
> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>
> at
> org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>
> at
> org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>
> at
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>
> at
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>
> at
> com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>
> at
> com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>
> at
> com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
> Source)
> at
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>
> at
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>
> at
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.doPost(Re portViewer.java:250)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>
> at
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>
> at
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>
> at
> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
> at
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>
> at
> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>
> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>
> at
> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>
> at
> com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>
> at
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>
> at
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>
> at
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>
> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
> at
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>
> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>
>
>
>
>
Re: Calling Java classes from Report Designs fails...(with errors) [message #258511 is a reply to message #258425] Tue, 16 October 2007 13:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kumolu.us.ibm.com

Jason Weathersby wrote:

> Dare,

> The APPCONTEXT_CLASSLOADER_KEY is useful if you are writing your own web
> app. The Web Viewer does this by default. This still looks like a
> loader issue. Can you write a blank report and add a data element with
> this expression?

> importPackage(Packages.com.ibm.tivoli.reporting.util);
> ReportingVersion.getBuildDate();

> And then run it? Make sure the ReportingVersion and all required
> classes are either in the ScriptLib or the web-inf/lib directory of the
> Viwer.

> Jason

> Dare Kumolu-Johnson wrote:
>> Jason Weathersby wrote:
>>
>>> Dare,
>>
>>> So you got the dummy class to work in the Web-inf/lib?
>>> If so, this most likely means your class is dependent on some other
>>> class that is not in the web-inf/lib.
>>
>>> Jason
>>
>>
>>> Dare Kumolu-Johnson wrote:
>>>> Jason Weathersby wrote:
>>>>
>>>>> Dare,
>>>>
>>>>> What error did you get in on the server with the dummy class?
>>>>
>>>>> Jason
>>>>
>>>>> Dare Kumolu-Johnson wrote:
>>>>>> Jason Weathersby wrote:
>>>>>>
>>>>>>> Dare,
>>>>>>
>>>>>>> If you have the classes in a jar in the Viewer web-inf/lib this
>>>>>>> should work. Where did you put the jars at when working in the
>>>>>>> designer?
>>>>>>> Also can you write a dummy class and call it just to verify that
>>>>>>> it is not another dependency that is causing the issue?
>>>>>>
>>>>>>> Jason
>>>>>>
>>>>>>> Dare Kumolu-Johnson wrote:
>>>>>>>> I am trying to call some Java classes that are not part of the
>>>>>>>> core Java API. It works fine in the designer having added the 2
>>>>>>>> jars that contain my referenced classes but on deploying my
>>>>>>>> reports to eWAS (the App Server we are using), it stops working.
>>>>>>>> This is regardless of the fact that the classes in my jars are
>>>>>>>> actually loaded on starting the WAS Server. I have also attempted
>>>>>>>> to move my jars to my Web App's lib dir and eWAS lib dir
>>>>>>>> including placing the .class files in WEB-INF/classes but all to
>>>>>>>> no avail. Here is the code that I have:
>>>>>>>>
>>>>>>>>
>>>>>>>> <method
>>>>>>
>>>>
>>
name="initialize"><![CDATA[//reportContext.setPersistentGlobalVariable( "buildDate",
>>
>>>>
>>>>>>
>>>>>>>> "tetet");
>>>>>>>> appContext = reportContext.getAppContext();
>>>>>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>>>>>> rptVersion = new ReportingVersion();
>>>>>>>> appContext.put("MyReportingVersion", rptVersion);
>>>>>>>> appContext = reportContext.getAppContext();
>>>>>>>> myObject = appContext.get("MyReportingVersion");
>>>>>>>> bldDate=myObject.getBuildDate()
>>>>>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>>>>>> bldDate);]]></method>
>>>>>>>>
>>>>>>>> And here is the point at which I am trying to display the text:
>>>>>>>> <text name="TCR Environment 1 Value" id="10003937">
>>>>>>>> <property name="marginTop">0pt</property>
>>>>>>>> <property name="paddingTop">1pt</property>
>>>>>>>> <property name="canShrink">false</property>
>>>>>>>> <method
>>>>>>
>>>>
>>
name="onRender"><![CDATA[reportContext.getPersistentGlobalVariable( "buildDate");]]></method>
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> <property name="contentType">html</property>
>>>>>>>> <text-property
>>>>>>
>>>>
>>
name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate");</VALUE-OF>]]></text-property>
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> </text>
>>>>>>>>
>>>>>>>> This was after failing at just making a direct call to my class's
>>>>>>>> method thus:
>>>>>>>> <text-property
>>>>>>
>>>>
>>
name="content"><![CDATA[<VALUE-OF> Packages.com.ibm.tivoli.reporting.util.ReportingVersion.getB uildDate(); </VALUE-OF>]]></text-property>
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Here is a copy of the exception thrown in the Server log:
>>>>>>>>
>>>>>>>> [10/9/07 16:42:17:031 EDT] 00000018 impl W
>>>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler
>>>>
>>>>>>>> runAndRenderReport(UserContext,Report,Map,RenderReportOption sLocal)
>>>>>>>> CTGTRE042W An error [ reference id = REPORTID_1_OBJECTID_55f455f4
>>>>>>>> ] occurred attempting to run and format the report [
>>>>>>>> /TivoliProducts/TCR/Overview ] with design [
>>>>>>>> /TivoliProducts/TCR/TCRInfrastructure.rptdesign ] . The error
>>>>>>>> message received from the report engine is [ There are errors
>>>>>>>> evaluating script
>>>>>>>> "//reportContext.setPersistentGlobalVariable("buildDate", "tetet");
>>>>>>>> appContext = reportContext.getAppContext();
>>>>>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>>>>>> rptVersion = new ReportingVersion();
>>>>>>>> appContext.put("MyReportingVersion", rptVersion);
>>>>>>>> appContext = reportContext.getAppContext();
>>>>>>>> myObject = appContext.get("MyReportingVersion");
>>>>>>>> bldDate=myObject.getBuildDate()
>>>>>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>>>>>> bldDate);":{1}. ] The report was generated, but may be incompleted.
>>>>>>>> [10/9/07 16:42:18:750 EDT] 00000018 ReportEngine E
>>>>>>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>>>>>>> org.mozilla.javascript.EcmaError:
>>>>>>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>>>>>>> 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.name(ScriptRuntime.java :1566)
>>>>>>>> at org.mozilla.javascript.gen.c69._c0(<inline>:4)
>>>>>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>>>>>> at
>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>>>>>>>
>>>>>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>>>>>> at org.mozilla.javascript.gen.c69.exec(<inline>)
>>>>>>>> at
>>>>>>>>
org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
>>
>>>>
>>>>>>
>>>>>>>> Source)
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>>>>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>>>>>>>> at
>>>>>>>> com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
>>>>>>>> at
>>>>>>
>>>>
>>
com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>>> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>>>>>>>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>>>>>>>>
>>>>>>>> Any ideas, pls? Thank you very much in advance!
>>>>>>>>
>>>>>> I tried the web-inf/lib and it failed on the Server. In the
>>>>>> designer, I added the jars to the project's build path and it
>>>>>> worked fine.
>>>>>> Wrote a dummy class to call the same methods and print out the same
>>>>>> BuildDate that I am trying to print out and that worked fine but I
>>>>>> couldn't get it to show on the report on adding it to the Report
>>>>>> Design and deploying the application.
>>>>>>
>>>> Didn't get any error with the dummy class.
>> Hi Jason -
>>
>> I have tried different things and it still doesn't work. All the
>> dependent classes wre copied int oweb-inf/lib. I also tried adding the
>> classes that I am calling to the scriptapi.jar file in BIRT and
>> repackaged it and it was the same dead end. Pls here is my code:
>> <method name="initialize"><![CDATA[appContext =
>> reportContext.getAppContext();
>>
>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>> appContext.put("MyReportingVersion",
>> ReportingVersion.getBuildDate());
>> myObject = appContext.get("MyReportingVersion");
>>
>> reportContext.setPersistentGlobalVariable("buildDate", myObject);]]>
>> </method>
>> and I accessing it here:
>>
>> <text-property
>>
name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate")</VALUE-OF>]]></text-property>
>>
>>
>> The methods I am calling are static; I'm not sure if that could have any
>> implication.
>> Someone mentioned something about
>>
engine.getConfig().getAppContext().put(EngineConstants.APPCO NTEXT_CLASSLOADER_KEY,
>>
>> ReportEngine.class.getClassLoader()) on
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=186272. Could that apply
>> to this and if so, how do I incorporate that into the code I have above?
>> Pls can you help me look into this? Thanks in advance for your prompt
>> reply.
>>
>> The exception thrown is here:
>>
>> [10/12/07 14:48:02:406 EDT] 0000001b ReportEngine E ReferenceError:
>> "ReportingVersion" is not defined. (<inline>#3)
>> org.mozilla.javascript.EcmaError:
>> ReferenceError: "ReportingVersion" is not defined. (<inline>#3)
>> 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.name(ScriptRuntime.java :1566)
>> at org.mozilla.javascript.gen.c345._c0(<inline>:3)
>> at org.mozilla.javascript.gen.c345.call(<inline>)
>> at
>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>> at
>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>> at org.mozilla.javascript.gen.c345.call(<inline>)
>> at org.mozilla.javascript.gen.c345.exec(<inline>)
>> at
>> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
>> at
>>
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>>
>> at
>>
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>>
>> at
>>
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>>
>> at
>>
org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>>
>> at
>>
org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>>
>> at
>>
org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>>
>> at
>>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>>
>> at
>>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>>
>> at
>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>>
>> at
>>
com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>>
>> at
>>
com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>>
>> at
>>
com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>>
>> at
>>
com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
>> Source)
>> at
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>>
>> at
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>>
>> at
>>
com.ibm.tivoli.reporting.reportViewer.ReportViewer.doPost(Re portViewer.java:250)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>> at
>>
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>>
>> at
>>
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>>
>> at
>>
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>>
>> at
>>
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>>
>> at
>> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
>> at
>>
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>>
>> at
>> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
>> at
>>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>>
>> at
>>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>>
>> at
>>
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>>
>> at
>>
com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>>
>> at
>>
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>>
>> at
>>
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>>
>> at
>>
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>>
>> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
>> at
>>
com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>>
>> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>>
>>
>>
>>
>>
Actually, we have our own WEB APP. What do I need to do with
APPCONTEXT_CLASSLOADER_KEY if we have our own web app? Thanks.
Re: Calling Java classes from Report Designs fails...(with errors) [message #258602 is a reply to message #258511] Wed, 17 October 2007 10:04 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Dare,

The example viewer uses code to the following in the
ReportEngineService class which essentially cranks up the BIRT runtime
and runs and renders the report.

HashMap context = new HashMap( );
context.put(
EngineConstants.APPCONTEXT_CLASSLOADER_KEY,ReportEngineServi ce.class.getClassLoader());
task.setAppContext( context );

So you could take this and add it to your code and set it, but change
ReportEngineService.class.getClassLoader to your appropriate class.


Jason


Dare Kumolu-Johnson wrote:
> Jason Weathersby wrote:
>
>> Dare,
>
>> The APPCONTEXT_CLASSLOADER_KEY is useful if you are writing your own
>> web app. The Web Viewer does this by default. This still looks like
>> a loader issue. Can you write a blank report and add a data element
>> with this expression?
>
>> importPackage(Packages.com.ibm.tivoli.reporting.util);
>> ReportingVersion.getBuildDate();
>
>> And then run it? Make sure the ReportingVersion and all required
>> classes are either in the ScriptLib or the web-inf/lib directory of
>> the Viwer.
>
>> Jason
>
>> Dare Kumolu-Johnson wrote:
>>> Jason Weathersby wrote:
>>>
>>>> Dare,
>>>
>>>> So you got the dummy class to work in the Web-inf/lib?
>>>> If so, this most likely means your class is dependent on some other
>>>> class that is not in the web-inf/lib.
>>>
>>>> Jason
>>>
>>>
>>>> Dare Kumolu-Johnson wrote:
>>>>> Jason Weathersby wrote:
>>>>>
>>>>>> Dare,
>>>>>
>>>>>> What error did you get in on the server with the dummy class?
>>>>>
>>>>>> Jason
>>>>>
>>>>>> Dare Kumolu-Johnson wrote:
>>>>>>> Jason Weathersby wrote:
>>>>>>>
>>>>>>>> Dare,
>>>>>>>
>>>>>>>> If you have the classes in a jar in the Viewer web-inf/lib this
>>>>>>>> should work. Where did you put the jars at when working in the
>>>>>>>> designer?
>>>>>>>> Also can you write a dummy class and call it just to verify that
>>>>>>>> it is not another dependency that is causing the issue?
>>>>>>>
>>>>>>>> Jason
>>>>>>>
>>>>>>>> Dare Kumolu-Johnson wrote:
>>>>>>>>> I am trying to call some Java classes that are not part of the
>>>>>>>>> core Java API. It works fine in the designer having added the 2
>>>>>>>>> jars that contain my referenced classes but on deploying my
>>>>>>>>> reports to eWAS (the App Server we are using), it stops
>>>>>>>>> working. This is regardless of the fact that the classes in my
>>>>>>>>> jars are actually loaded on starting the WAS Server. I have
>>>>>>>>> also attempted to move my jars to my Web App's lib dir and eWAS
>>>>>>>>> lib dir including placing the .class files in WEB-INF/classes
>>>>>>>>> but all to no avail. Here is the code that I have:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> <method
>>>>>>>
>>>>>
>>>
> name="initialize"><![CDATA[//reportContext.setPersistentGlobalVariable( "buildDate",
>
>>>
>>>>>
>>>>>>>
>>>>>>>>> "tetet");
>>>>>>>>> appContext = reportContext.getAppContext();
>>>>>>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>>>>>>> rptVersion = new ReportingVersion();
>>>>>>>>> appContext.put("MyReportingVersion", rptVersion);
>>>>>>>>> appContext = reportContext.getAppContext();
>>>>>>>>> myObject = appContext.get("MyReportingVersion");
>>>>>>>>> bldDate=myObject.getBuildDate()
>>>>>>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>>>>>>> bldDate);]]></method>
>>>>>>>>>
>>>>>>>>> And here is the point at which I am trying to display the text:
>>>>>>>>> <text name="TCR Environment 1 Value" id="10003937">
>>>>>>>>> <property name="marginTop">0pt</property>
>>>>>>>>> <property name="paddingTop">1pt</property>
>>>>>>>>> <property name="canShrink">false</property>
>>>>>>>>> <method
>>>>>>>
>>>>>
>>>
> name="onRender"><![CDATA[reportContext.getPersistentGlobalVariable( "buildDate");]]></method>
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> <property name="contentType">html</property>
>>>>>>>>> <text-property
>>>>>>>
>>>>>
>>>
> name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate");</VALUE-OF>]]></text-property>
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> </text>
>>>>>>>>>
>>>>>>>>> This was after failing at just making a direct call to my
>>>>>>>>> class's method thus:
>>>>>>>>> <text-property
>>>>>>>
>>>>>
>>>
> name="content"><![CDATA[<VALUE-OF> Packages.com.ibm.tivoli.reporting.util.ReportingVersion.getB uildDate(); </VALUE-OF>]]></text-property>
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Here is a copy of the exception thrown in the Server log:
>>>>>>>>>
>>>>>>>>> [10/9/07 16:42:17:031 EDT] 00000018 impl W
>>>>>
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler
>>>>>
>>>>>>>>> runAndRenderReport(UserContext,Report,Map,RenderReportOption sLocal)
>>>>>>>>> CTGTRE042W An error [ reference id =
>>>>>>>>> REPORTID_1_OBJECTID_55f455f4 ] occurred attempting to run and
>>>>>>>>> format the report [ /TivoliProducts/TCR/Overview ] with design
>>>>>>>>> [ /TivoliProducts/TCR/TCRInfrastructure.rptdesign ] . The error
>>>>>>>>> message received from the report engine is [ There are errors
>>>>>>>>> evaluating script
>>>>>>>>> "//reportContext.setPersistentGlobalVariable("buildDate",
>>>>>>>>> "tetet");
>>>>>>>>> appContext = reportContext.getAppContext();
>>>>>>>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>>>>>>>> rptVersion = new ReportingVersion();
>>>>>>>>> appContext.put("MyReportingVersion", rptVersion);
>>>>>>>>> appContext = reportContext.getAppContext();
>>>>>>>>> myObject = appContext.get("MyReportingVersion");
>>>>>>>>> bldDate=myObject.getBuildDate()
>>>>>>>>> reportContext.setPersistentGlobalVariable("buildDate",
>>>>>>>>> bldDate);":{1}. ] The report was generated, but may be
>>>>>>>>> incompleted.
>>>>>>>>> [10/9/07 16:42:18:750 EDT] 00000018 ReportEngine E
>>>>>>>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#4)
>>>>>>>>>
>>>>>>>>> org.mozilla.javascript.EcmaError: ReferenceError:
>>>>>>>>> "ReportingVersion" is not defined. (<inline>#4)
>>>>>>>>> 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.name(ScriptRuntime.java :1566)
>>>>>>>>> at org.mozilla.javascript.gen.c69._c0(<inline>:4)
>>>>>>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>>>>>>> at
>>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>>>>>>>>
>>>>>>>>> at
> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>>>>>>>>
>>>>>>>>> at org.mozilla.javascript.gen.c69.call(<inline>)
>>>>>>>>> at org.mozilla.javascript.gen.c69.exec(<inline>)
>>>>>>>>> at
> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
>
>>>
>>>>>
>>>>>>>
>>>>>>>>> Source)
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>>>>>>>>> at
>>>>>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>
> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>>>>>>>>> at
>>>>>>>>> com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
>>>>>>>>> at
>>>>>>>
>>>>>
>>>
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>
>>>
>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>>>>>>>>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>>>>>>>>>
>>>>>>>>> Any ideas, pls? Thank you very much in advance!
>>>>>>>>>
>>>>>>> I tried the web-inf/lib and it failed on the Server. In the
>>>>>>> designer, I added the jars to the project's build path and it
>>>>>>> worked fine.
>>>>>>> Wrote a dummy class to call the same methods and print out the
>>>>>>> same BuildDate that I am trying to print out and that worked fine
>>>>>>> but I couldn't get it to show on the report on adding it to the
>>>>>>> Report Design and deploying the application.
>>>>>>>
>>>>> Didn't get any error with the dummy class.
>>> Hi Jason -
>>>
>>> I have tried different things and it still doesn't work. All the
>>> dependent classes wre copied int oweb-inf/lib. I also tried adding
>>> the classes that I am calling to the scriptapi.jar file in BIRT and
>>> repackaged it and it was the same dead end. Pls here is my code:
>>> <method name="initialize"><![CDATA[appContext =
>>> reportContext.getAppContext();
>>>
>>> importPackage(Packages.com.ibm.tivoli.reporting.util)
>>> appContext.put("MyReportingVersion",
>>> ReportingVersion.getBuildDate());
>>> myObject = appContext.get("MyReportingVersion");
>>>
>>> reportContext.setPersistentGlobalVariable("buildDate", myObject);]]>
>>> </method>
>>> and I accessing it here:
>>>
>>> <text-property
> name="content"><![CDATA[<VALUE-OF>reportContext.getPersistentGlobalVariable( "buildDate")</VALUE-OF>]]></text-property>
>
>>>
>>>
>>> The methods I am calling are static; I'm not sure if that could have
>>> any implication.
>>> Someone mentioned something about
> engine.getConfig().getAppContext().put(EngineConstants.APPCO NTEXT_CLASSLOADER_KEY,
>
>>>
>>> ReportEngine.class.getClassLoader()) on
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=186272. Could that
>>> apply to this and if so, how do I incorporate that into the code I
>>> have above? Pls can you help me look into this? Thanks in advance for
>>> your prompt reply.
>>>
>>> The exception thrown is here:
>>>
>>> [10/12/07 14:48:02:406 EDT] 0000001b ReportEngine E
>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#3)
>>> org.mozilla.javascript.EcmaError:
>>> ReferenceError: "ReportingVersion" is not defined. (<inline>#3)
>>> 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.name(ScriptRuntime.java :1566)
>>> at org.mozilla.javascript.gen.c345._c0(<inline>:3)
>>> at org.mozilla.javascript.gen.c345.call(<inline>)
>>> at
>>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>> at
>>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>> at org.mozilla.javascript.gen.c345.call(<inline>)
>>> at org.mozilla.javascript.gen.c345.exec(<inline>)
>>> at
>>> org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:223)
>>> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:576)
>
>>>
>>> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:555)
>
>>>
>>> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJSInternal(ScriptExecutor.java:61)
>
>>>
>>> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleJS(ScriptExecutor.java:45)
>
>>>
>>> at
> org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:30)
>
>>>
>>> at
> org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1187)
>
>>>
>>> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:82)
>
>>>
>>> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:68)
>
>>>
>>> at
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngineR unRenderHandler.runAndRenderReport(BIRTReportEngineRunRender Handler.java:1117)
>
>>>
>>> at
> com.ibm.tivoli.reporting.reportEngine.impl.BIRTReportEngine. runAndRenderReport(BIRTReportEngine.java:840)
>
>>>
>>> at
> com.ibm.tivoli.reporting.common.runAndRender.RunAndRenderSer vices.runAndrenderReport(RunAndRenderServices.java:892)
>
>>>
>>> at
> com.ibm.tivoli.reporting.ejb.TivoliReportingEJBBean.runAndre nderReport(TivoliReportingEJBBean.java:4515)
>
>>>
>>> at
> com.ibm.tivoli.reporting.ejb.EJSLocalStatelessTivoliReportin gEJB_f305bd50.runAndrenderReport(Unknown
>
>>> Source)
>>> at
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.processRe quest(ReportViewer.java:527)
>
>>>
>>> at
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.doGet(Rep ortViewer.java:195)
>
>>>
>>> at
> com.ibm.tivoli.reporting.reportViewer.ReportViewer.doPost(Re portViewer.java:250)
>
>>>
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>>> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(Servl etWrapper.java:995)
>
>>>
>>> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:501)
>
>>>
>>> at
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleReque st(ServletWrapper.java:464)
>
>>>
>>> at
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRe quest(CacheServletWrapper.java:90)
>
>>>
>>> at
>>> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContai ner.java:744)
>>>
>>> at
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebCont ainer.java:1433)
>
>>>
>>> at
>>> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChanne lLink.java:112)
>>>
>>> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleD iscrimination(HttpInboundLink.java:454)
>
>>>
>>> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleN ewInformation(HttpInboundLink.java:383)
>
>>>
>>> at
> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.com plete(HttpICLReadCallback.java:102)
>
>>>
>>> at
> com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCom pletedCallback.complete(SSLReadServiceContext.java:1815)
>
>>>
>>> at
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.future Completed(AioReadCompletionListener.java:165)
>
>>>
>>> at
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(Abstract AsyncFuture.java:217)
>
>>>
>>> at
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(As yncChannelFuture.java:161)
>
>>>
>>> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>>> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:1 95)
>>> at
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(Result Handler.java:743)
>
>>>
>>> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
>>>
>>>
>>>
>>>
>>>
> Actually, we have our own WEB APP. What do I need to do with
> APPCONTEXT_CLASSLOADER_KEY if we have our own web app? Thanks.
>
Previous Topic:OC4J server - How to deploy BIRT
Next Topic:Yellowfin Release 3.3 Released
Goto Forum:
  


Current Time: Mon Nov 10 11:48:23 EST 2025

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

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

Back to the top