Bug 332056 - Designer Classpath problems
Summary: Designer Classpath problems
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.6.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Birt-ReportDesigner CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-07 12:15 EST by Jim Garrison CLA
Modified: 2014-03-03 19:16 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Garrison CLA 2010-12-07 12:15:01 EST
Assume you have an existing Java project, call it "x", with several Java Build-Path Classpath variables.  Assume also that this project "exports" its libraries based on Classpath variables.

If you create a Report project and specify a dependency on "x" using the Report Design/Classpath functionality introduced in 2.5.2 (http://birtworld.blogspot.com/2009/12/birt-designer-classpath-changes.html), then when previewing a report the Report project will attempt to interpret those exported classpaths relative to the Eclipse home, with the variable name taken literally, resulting in a FileNotFoundException for each one.  Example:

Dec 7, 2010 11:03:32 AM org.eclipse.birt.core.framework.URLClassLoader createLoader
WARNING: can not load the class from file:/C:/dev/tools/eclipse-SR1/WORKLIB/spring-tx.jar
java.io.FileNotFoundException: C:\dev\tools\eclipse-SR1\WORKLIB\spring-tx.jar (The system cannot find the path specified)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(Unknown Source)
        at java.util.jar.JarFile.<init>(Unknown Source)
   [snip]

Dec 7, 2010 11:03:32 AM org.eclipse.birt.core.framework.URLClassLoader createLoader
WARNING: can not load the class from file:/C:/dev/tools/eclipse-SR1/WORKLIB/spring-aop.jar
java.io.FileNotFoundException: C:\dev\tools\eclipse-SR1\WORKLIB\spring-aop.jar (The system cannot find the path specified)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(Unknown Source)
        at java.util.jar.JarFile.<init>(Unknown Source)
   [snip]

Dec 7, 2010 11:03:32 AM org.eclipse.birt.core.framework.URLClassLoader createLoader
WARNING: can not load the class from file:/C:/dev/tools/eclipse-SR1/WORKLIB/spring-asm.jar
java.io.FileNotFoundException: C:\dev\tools\eclipse-SR1\WORKLIB\spring-asm.jar (The system cannot find the path specified)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(Unknown Source)
        at java.util.jar.JarFile.<init>(Unknown Source)
   [snip]

Dec 7, 2010 11:03:32 AM org.eclipse.birt.core.framework.URLClassLoader createLoader
WARNING: can not load the class from file:/C:/dev/tools/eclipse-SR1/WORKLIB/spring-aspects.jar
java.io.FileNotFoundException: C:\dev\tools\eclipse-SR1\WORKLIB\spring-aspects.jar (The system cannot find the path specified)

   [ad nauseum]


In this case WORKLIB is the name of a Classpath variable defined in a project specified as a classpath dependency in a Report project.  What's even more curious is that the Report project is being run inside an Eclipse instance where WORKLIB is defined at the global level.  So it appears that the Report Design Classpath facility is misinterpreting variable-based classpaths.
Comment 1 Jim Garrison CLA 2010-12-07 12:40:36 EST
Further testing confirms that using Workspace-global Classpath variables in the Preferences/Report Design/Classpath dialog does not work at all.  I've been fighting classpath problems in a simple Scripted Dataset tutorial, and find that everything works if I use explicit paths to refer to the JDBC driver jar instead of classpath variables.

Also, it appears that the FAQ item about placing jars in the birt/scriptlib directory of the Web Viewer plugin is no longer correct, and should be updated.