It's all about the answers!

Ask a question

Include Java code in BIRT reports


Leonardo Marzo (24954852) | asked Jul 21 '14, 4:55 p.m.
edited Jul 22 '14, 9:10 a.m.
  Hi, 

I´m trying to create a BIRT report that includes Java code. I have followed all the steps in this blog:
https://www.ibm.com/developerworks/community/blogs/JazzyTunes/entry/creating_birt_reports_for_rtc_which_invokes_java_code?maxresults=15&lang=en

However, when I restart the server, I see the following error in the ccm log:
[       Launch callback handler]  WARN eam.repository.provision.internal.ProvisionService  - CRJZS0383E The "com.ibm.team.reports.service.birt.myjavacode" bundle could not be resolved.

As a consequence, I´m not able to execute the Java code from the BIRT report.

I´m using CLM 5.0. I don't know what I´m doing wrong. Those steps also apply for 5.0?
(same issue with 4.0.5)

This is my configuration (ignore the <o:p> tags and some others that were added by the wiki editor):

Fragment MANIFEST.MF
------------------------------------

Manifest-Version: 1.0

Bundle-ManifestVersion: 2

Bundle-Name: com.ibm.team.reports.service.birt.myjavacode

Bundle-SymbolicName: com.ibm.team.reports.service.birt.myjavacode;singleton:=true

Bundle-Version: 1.0.0.qualifier

Fragment-Host: com.ibm.team.reports.service.birt;bundle-version="[2.2.3000.v20131217_0302,3.0.0)"

Bundle-RequiredExecutionEnvironment: JavaSE-1.6


feature.xml

--------------

<?xml version="1.0" encoding="UTF-8"?>

<feature

      id="com.ibm.team.reports.service.birt.myjavacode.feature"

      label="com.ibm.team.reports.service.birt.myjavacode.feature"

      version="1.0.0.qualifier">

    <plugin

         id="com.ibm.team.reports.service.birt.myjavacode"

         download-size="0"

         install-size="0"

         version="1.0.0.qualifier"

         fragment="true"

         unpack="false"/>

 </feature>

  

Site.xml

-------------------

<?xml version="1.0" encoding="UTF-8"?>

<site>

   <feature url="features/com.ibm.team.reports.service.birt.myjavacode.feature_1.0.0.201407211705.jar" id="com.ibm.team.reports.service.birt.myjavacode.feature" version="1.0.0.201407211705"/>

</site>

provision file (myjavacode_provision.ini) 

url=file:ccm/sites/myjavacode-update-site

featureid=com.ibm.team.reports.service.birt.myjavacode.feature


I´ll appreciate your help

3 answers



permanent link
Donald Nong (14.4k314) | answered Jul 22 '14, 3:01 a.m.
The deployment of the update site may not be successful. Check the install.log file which can be found under the working folder of the CCM application.
For WAS:
<wasprofile>/temp/<node>/<server>/ccm/ccm.war/eclipse/configuration/org.eclipse.osgi/bundles/21/data
For Tomcat:
/opt/IBM/JazzTeamServer/server/tomcat/work/Catalina/localhost/ccm/eclipse/configuration/org.eclipse.osgi/bundles/22/data
You may get a number different from 21 or 22, just do a search under "bundles".

Comments
Leonardo Marzo commented Jul 22 '14, 8:19 a.m. | edited Jul 22 '14, 9:08 a.m.
 Thanks for the answer Donald. I see the following lines in the install.log:

The profile install from "file:ccm/sites/myjavacode-update-site" was started at "Mon Jul 21 18:25:34 ART 2014"..

This feature is being installed: "com.ibm.team.reports.service.birt.myjavacode.feature_1.0.0.201407211822".

Installing bundle from the URL
"file:/C%3a/user/rtc/Extend/RTC405~1/installs/JAZZTE~1/server/conf/ccm/sites/myjavacode-update-site/plugins/com.ibm.team.reports.service.birt.myjavacode_1.0.0.201407211822.jar".

And then when the bundles are starting:
CRJZS0383E The "com.ibm.team.reports.service.birt.myjavacode" bundle could not be resolved.





permanent link
Leonardo Marzo (24954852) | answered Jul 22 '14, 3:58 p.m.
edited Jul 22 '14, 3:59 p.m.
Well, a bit closer. The problem was the version of the fragment's hosting plugin com.ibm.team.reports.service.birt. I was using 2.2.3000.v20131217_0302, however the version deployed in the server is 2.2.2000.v20131010_0700".

Now I dont' see any errors in the provision status, however the script fails when tries to invoke that Java code. This is the script I´m using:
importPackage(Packages.com.arris.mypackage);
index = 0;
var myJavaObj = new Packages.com.arris.mypackage.MyJavaClass();

Is there any way to verify that the Fragment was included properly in the BIRT plugin? 

permanent link
Leonardo Marzo (24954852) | answered Jul 22 '14, 4:35 p.m.
 There we go! The problem is that the script fails in Preview mode, but it works when you create the Resource and then create a report from that resource. 

Hope it can help somebody else. 

Thanks, 

Your answer


Register or to post your answer.