Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 169714 - Incorrect classpath setting in genReport scripts in BIRT2.2 M2 runtime download
Summary: Incorrect classpath setting in genReport scripts in BIRT2.2 M2 runtime download
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.2.0 M5   Edit
Assignee: Xiaoying Gu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 170176
Blocks:
  Show dependency tree
 
Reported: 2007-01-05 14:08 EST by Sunitha Kambhampati CLA
Modified: 2008-06-18 14:46 EDT (History)
0 users

See Also:


Attachments
patched genReport.bat (1.49 KB, patch)
2007-01-05 18:21 EST, Sunitha Kambhampati CLA
bjorn.freeman-benson: iplog+
Details | Diff
Patched genReport.sh (1.12 KB, patch)
2007-01-05 18:22 EST, Sunitha Kambhampati CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sunitha Kambhampati CLA 2007-01-05 14:08:39 EST
I have a report design that worked ok using the genReport scripts in 2.1.1. This does not work anymore using the genReport script on 2.2.

It fails with a ClassNotFoundException in com.ibm.icu.text.SimpleDateFormat.

The reason is because of this:
In birt 2.1.1 - this class is in com.ibm.icu_3.4.4.1.jar
In birt 2.2.0 - this class is in com.ibm.icu_3.4.5.jar

The genReport.sh in birt 2.2 download does not set it to the correct version but instead points to the old one - com.ibm.icu_3.4.4.1.jar

Thus the classpath is not set correctly and the error.

I did an eclipse compare of the runtime downloads -- birt 2.1.1 and birt 2.2.0 and lots of jar versions have changed. Along with fixing this particular issue, it might be good to investigate if all the jars etc used in birt 2.2 runtime are correctly included in the classpath. 

-----------------
Also, I put the component as ReportEngine but maybe this is more of a documentation /scripts issue.  Can someone please help me in figuring out which component it should go so I can assign it to the correct component.
Comment 1 Sunitha Kambhampati CLA 2007-01-05 16:39:40 EST
I made a patch for 164697 issue and to run the scripts successfully, this issue needs to be fixed. I'll take a look at this issue and try to post a patch. 

Actually, even a blank rptdesign wont work with the current scripts.   
Here is the stack trace.
C:\BIRT\birt-runtime-2_2_0\ReportEngine>genReport C:\BIRT\trunk2\samplesReport\blank.rptdesign

C:\BIRT\birt-runtime-2_2_0\ReportEngine>ECHO off
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/icu/text/SimpleDateFormat
        at org.eclipse.birt.report.model.metadata.DateTimePropertyType.<clinit>(DateTimePropertyType.java:61)
        at org.eclipse.birt.report.model.metadata.MetaDataDictionary.<init>(MetaDataDictionary.java:229)
        at org.eclipse.birt.report.model.metadata.MetaDataDictionary.<clinit>(MetaDataDictionary.java:107)
        at org.eclipse.birt.report.model.api.impl.DesignEngineImpl.newSessionHandle(DesignEngineImpl.java:122)
        at org.eclipse.birt.report.model.api.DesignEngine.newSessionHandle(DesignEngine.java:106)
        at org.eclipse.birt.report.engine.parser.ReportParser.getDesignHandle(ReportParser.java:146)
        at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:244)
        at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:192)
        at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:126)
        at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:225)
        at org.eclipse.birt.report.engine.api.ReportRunner.runAndRenderReport(ReportRunner.java:189)
        at org.eclipse.birt.report.engine.api.ReportRunner.execute(ReportRunner.java:162)
        at org.eclipse.birt.report.engine.api.ReportRunner.main(ReportRunner.java:118)
Comment 2 Sunitha Kambhampati CLA 2007-01-05 18:21:06 EST
Created attachment 56501 [details]
patched genReport.bat
Comment 3 Sunitha Kambhampati CLA 2007-01-05 18:22:02 EST
Created attachment 56502 [details]
Patched genReport.sh
Comment 4 Sunitha Kambhampati CLA 2007-01-05 18:24:58 EST
In another bug 164697, Wenfeng Li suggested to attach the source file for the scripts. So I am attaching the source files (genReport.bat, genReport.sh)

This patch fixes the following issues that were found in the script files in the birt 2.2 M2 runtime download.

The BIRTCLASSPATH setting needs the following corrections:
1. %BIRT_HOME%/ReportEngine/flute.jar  - Incorrect location for jar.  Needs to be %BIRT_HOME%/ReportEngine/lib/flute.jar
2. com.ibm.icu_3.4.4.1.jar needs to be com.ibm.icu_3.4.5.jar
3. org.eclipse.emf.ecore_2.2.0.v200606051102.jar needs to be org.eclipse.emf.ecore_2.2.1.v200609210005.jar
4. org.eclipse.emf.ecore.xmi_2.2.0.v200606051102.jar needs to be org.eclipse.emf.ecore.xmi_2.2.1.v200609210005.jar
5. org.eclipse.emf.common_2.2.0.v200606051102.jar needs to be org.eclipse.emf.common_2.2.1.v200609210005.jar
6. chartengineapi.jar does not exist. I think it should be org.eclipse.birt.chart.engine_2.2.0.v20061117-1020.jar

I ran tests with these scripts with some sample rptdesign files on windows (for the .bat file) and on linux (for the .sh file)  and things work OK. 

Can some committer please review these changes. This is my first patch to BIRT and I would appreciate your comments.

Thanks much.
Comment 5 Sunitha Kambhampati CLA 2007-01-05 18:51:42 EST
Please note that the attached patch fixes the issue mentioned in this bugzilla. 

But as I was working on this issue, I found some other things and wanted to get feedback from the community.  Should these questions be targeted to the birt-dev mailing list or is this bugzilla comment the right place. 

Here are my notes:

In the 2.1.1 birt runtime download, 
all the jars in the ReportEngine/lib directory have been added to the birt classpath with exception of dataadapterapi.jar

In the 2.2.0 birt runtime download, 
apart from the issues fixed above, there are more jars available. 

The following jars are available:
axis-ant.jar
axis.jar
commons-discovery-0.2.jar
jaxrpc.jar
org.eclipse.birt.chart.engine_2.2.0.v20061117-1020.jar  ( I think this supercedes the chartengineapi.jar in birt 2.1.1 download)
saaj.jar
viewservlets.jar
wsdl4j-1.5.1.jar

-- Should these jars ALSO be added to birt classpath ?
-- It seems like genReport is specific to each release, so maybe it is better to checkin this script in the cvs.  
-- Maybe we can add some notes, so when the birt runtime download is generated for a release, or if any of the dependency jars that have version number in their name change, the scripts are also updated.  

Thoughts/comments?

Thanks,
Sunitha.
Comment 6 Xiaoying Gu CLA 2007-01-11 03:40:51 EST
axis-ant.jar
axis.jar
commons-discovery-0.2.jar
jaxrpc.jar
saaj.jar
viewservlets.jar
wsdl4j-1.5.1.jar

shouldn't be included in ReportEngine/lib folder, since ReportEngine don't need them. Build scripts has exclude these jars.

As to inconsistent classpath, I've submit a new bug 170176. It better to generate genReport.bat/sh autmatically by script. So the similar problem could be avoided in later release.

Thanks for reporting!
Comment 7 Sunitha Kambhampati CLA 2007-01-11 12:33:23 EST
Thanks Xiaoying for the reply.  I agree that is a good idea.  Thanks for taking care of this. 
Comment 8 Xiaoying Gu CLA 2007-01-11 22:48:45 EST
Fixed.
Comment 9 Sunitha Kambhampati CLA 2007-01-17 13:56:56 EST
Thanks Xiaoying for reviewing my patch. 

I have one comment - I think this issue should not be marked fixed till the fix goes into eclipse CVS. Please see the discussion on birt-dev in http://dev.eclipse.org/mhonarc/lists/birt-dev/msg06962.html
"The committer should make sure that the changes go up to the CVS first before marking the bug as fixed. "
Comment 10 Bjorn Freeman-Benson CLA 2008-06-18 14:46:20 EDT
Comment on attachment 56501 [details]
patched genReport.bat

per Ganymede IP log
Comment 11 Bjorn Freeman-Benson CLA 2008-06-18 14:46:25 EDT
Comment on attachment 56502 [details]
Patched genReport.sh

per Ganymede IP log