Community
Participate
Working Groups
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.
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.