Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Deploying to BIRT 4.2 Viewer Web App
Ben26
I am new to BIRT and I am having a hair-pulling time of it getting the report to execute in the BIRT Viewer running on Tomcat. <br />
<br />
To begin, I have performed the following tasks:<br />
<br />
<ul class='bbc'><li> installed BIRT 4.2.1 to Tomcat 6.32 running on an iSeries machine </li><li> developed the design file using Eclipse, Version: Juno Service Release 1 Build id: 20120920-0800.</li><li> deployed the design file to Tomcat's webapps\BIRT421\reportDesignFiles directory which has been configured using the web.xml file via:<br />
<p class='bbc_indent' style='margin-left: 40px;'><context-param><br />
<p class='bbc_indent' style='margin-left: 40px;'><param-name>BIRT_VIEWER_WORKING_FOLDER</param-name><br />
<param-value>/reportDesignFiles</param-value></p></context-param></p></li><li> placed the .jar-file containing the project's DAO and VO class files into Tomcat's <br />
<p class='bbc_indent' style='margin-left: 40px;'>WEB-INF directory or,(never and)<br />
WEB-INF/lib directory <br />
depending on the execution at the time, while trying to get this to work</p></li></ul>
<br />
The report design uses a scripted data source which runs like a charm inside Eclipse using the Preview tab. It executes the DAO which registers the JDBC driver, constructs the SQL using the parms passed to the report, and executes the statement without error. It then iterates through the resultSet, placing each record's values into a Value Object (VO) which is then returned to the report's javascript which called the DAO and the report results are displayed.<br />
<br />
The trouble is, when I deploy the design-file and the project's class files in its jar to the BIRT Viewer app in Tomcat, no matter what is tried in terms of the location of the .jar-file or variation of importPackage syntax I have seen out there on the web, I always get this error:<br />
<br />
<p class='bbc_indent' style='margin-left: 40px;'>TypeError: [JavaPackage DocumentRequestListDAO] is not a function, it is object.</p>
<br />
<br />
<br />
Here are the details of the javascript call. Note that the importPackage statements have been commented as a consequence of the last test run which issued the error. <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 4.2.1.v201209101448 Build <4.2.1.v20120912-1721></property>
<list-property name="includeScripts">
<property>scripts/debugWindow.js</property>
</list-property>
<property name="units">in</property>
<method name="initialize"><![CDATA[//importPackage(Packages.java.util);
//importPackage(Packages.java.lang);
//importPackage(Packages.DocumentRequestListDAO);
//importPackage(Packages.DCSDCPReportFieldsVO);
var documentRequestListDAO = new Packages.DocumentRequestListDAO;
var dcsdcpReportFieldsVO = new Packages.DCSDCPReportFieldsVO;
var paramArray = new Packages.java.util.ArrayList();
paramArray.add( params["PARAM_UNIQUEID01"] );
paramArray.add( params["PARAM_UNIQUEID02"] );
paramArray.add( params["PARAM_UNIQUEID03"] );
paramArray.add( params["PARAM_UNIQUEID04"] );
documentRequestListDAO.process(paramArray);
var listOfRecords = new Packages.java.util.ArrayList;
listOfRecords = documentRequestListDAO.getListOfDCSDCPReportFieldsVO()
var size = documentRequestListDAO.getSize();
:
:
:
</pre>
<br />
Can someone please tell me what I am doing wrong? And can someone please point me to relevant documentation for BIRT 4.2.1. Just about everything I see 'out there' relates to BIRT 2.n or 3.n.<br />
<br />
Thanks in advance,<br />
Ben
Find more posts tagged with
Comments
mwilliams
Can you attach your java file(s)?
Ben26
Sure.
The DAO is designed to establish a connection based upon the Tomcat instance within which it is running. One Tomcat is assigned a TEST role while the other is a PROD role. JNDI would be great, since it is already established for both instances, but for now and until I can figure out how to get BIRT to accomplish that, the approach embedded in the DAO (and cannot yet test) will suffice.
The classes as presented do not reside in a package, hence the absence of a package statement. They used to reside in com.mig.officedocsysreport.dao and com.mig.officedocsysreport.vo, respectively, but have been reduced to none as a result of the last test run. This is why the importPackage statement in the script have been commented out.
I should add that the jar file has also been placed into scriptlib as per latest documentation. Results are the same even after server bounced.
Ben26
So, any ideas?
mwilliams
Have you added your jar file as a resource in the resources tab of the property editor for the report design?
mwilliams
Though, that doesn't seem to be a problem for me. With or without declaring it as a resource, it seems to recognize the proper class file for me. Can you attach your jar files?
Ben26
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="116011" data-time="1366060025" data-date="15 April 2013 - 02:07 PM"><p>
Have you added your jar file as a resource in the resources tab of the property editor for the report design?<br /></p></blockquote>
<br />
Isn't the resource, which seems to reference the workspace, simply to satisfy Eclipse during development? If not, doesn't it present a circular reference of sorts? I mean, if we are to put the .jar-file into the scriptlib, (which is where my jar resides, because the project has reached a level of development which allowed for it to be created) how would defining a resource to a jar that does not yet exist (during early stages of development) solve this problem especially since when deployed, the path of the resource should then reflect that of Tomcat??? Very confusing as you can see.
Ben26
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="116012" data-time="1366060537" data-date="15 April 2013 - 02:15 PM"><p>
Though, that doesn't seem to be a problem for me. With or without declaring it as a resource, it seems to recognize the proper class file for me. Can you attach your jar files?<br /></p></blockquote>
<br />
Well, apparently I'm not allowed i.e. "Error You aren't permitted to upload this kind of file"<br />
<br />
It will suffice to say the class files represented by the 2 java files previously attached comprise the jar-file.
mwilliams
Yeah. It should only be for development, but I just more or less wanted you to test to see if there was something up.
As for attaching the file, I'd just like to use your jar file. I created one of my own and had no issues, except I was missing the param class that you have. If you zip it up, you can upload it that way.
Ben26
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="116071" data-time="1366226631" data-date="17 April 2013 - 12:23 PM"><p>
Yeah. It should only be for development, but I just more or less wanted you to test to see if there was something up.<br /></p></blockquote>
I see this remedy offered many, many times even though the hapless developer has indicated they are having trouble when deploying and attempting to run the report on the server. I've always scratched my head on that one and wonder if I'm missing something myself.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="116071" data-time="1366226631" data-date="17 April 2013 - 12:23 PM"><p>
As for attaching the file, I'd just like to use your jar file. I created one of my own and had no issues, except I was missing the param class that you have. If you zip it up, you can upload it that way.<br /></p></blockquote>
<br />
Actually that is exactly what I attempted when I got the error message. I think I know the class you're talking about. I've attached it here. <br />
<br />
What is the likelihood we can get this resolved? I have gone out on a limb to include this BIRT report in the project which has since moved into BETA rollout for the intended department without it. We want to rely upon BIRT going forward and really want to see this work.<br />
<br />
Thanks,<br />
Ben
mwilliams
Thanks. This will help clear one of the errors. I'm really interested in trying it with your jar file. Can you email it to me at mwilliams at actuate? Thanks!