Project: Birt
Bug 271741 Setting a folder as webapp class path leads to error.
Reported: 2009-04-09 03:59:43 | Status: verified fixed

This error happens when a folder is set into EngineConfig as webapp class loader. Reproduce steps: 1. create EngineConfig as follows, spcifiy a folder as WEBAPP_CLASSPATH_KEY. EngineConfig engineConfig = new EngineConfig(); engineConfig.setProperty(EngineConstants.WEBAPP_CLASSPATH_KEY, "file:/%Folder path%" ); 2. create a ReportEngine with above engine config, create an engine task(RunTask, RenderTask, etc.) using the report engine, then run the task. Then error message displayed: NIO: can't load the class from file:/D:/workspace/BIRT%20express2/org.eclipse.birt.report.tests.engine/src/org/eclipse/birt/report/tests/engine/api/input/scripts java.util.zip.ZipException: The system cannot find the file specified at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:203) at java.util.jar.JarFile.<init>(JarFile.java:132) at java.util.jar.JarFile.<init>(JarFile.java:70) at org.eclipse.birt.core.framework.URLClassLoader$JarLoader.<init>(URLClassLoader.java:319) at org.eclipse.birt.core.framework.URLClassLoader.createLoader(URLClassLoader.java:498) at org.eclipse.birt.core.framework.URLClassLoader.<init>(URLClassLoader.java:94) at org.eclipse.birt.report.engine.api.impl.ReportEngine.createEngineClassLoader(ReportEngine.java:758) at org.eclipse.birt.report.engine.api.impl.ReportEngine.getEngineClassLoader(ReportEngine.java:712) at org.eclipse.birt.report.engine.executor.ApplicationClassLoader.createDesignClassLoader(ApplicationClassLoader.java:135) at org.eclipse.birt.report.engine.executor.ApplicationClassLoader.loadClass(ApplicationClassLoader.java:76) at org.eclipse.birt.core.script.ScriptContext.setApplicationClassLoader(ScriptContext.java:409) at org.eclipse.birt.report.engine.executor.ExecutionContext.getApplicationClassLoader(ExecutionContext.java:1687) at org.eclipse.birt.report.engine.executor.ExecutionContext.initializeScriptContext(ExecutionContext.java:413) at org.eclipse.birt.report.engine.executor.ExecutionContext.getScriptContext(ExecutionContext.java:1005) at org.eclipse.birt.report.engine.executor.ExecutionContext.getSharedScope(ExecutionContext.java:998) at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.<init>(AbstractDataEngine.java:105) at org.eclipse.birt.report.engine.data.dte.DteDataEngine.<init>(DteDataEngine.java:56) at org.eclipse.birt.report.engine.data.DataEngineFactory.createDataEngine(DataEngineFactory.java:101) at org.eclipse.birt.report.engine.executor.ExecutionContext.openDataEngine(ExecutionContext.java:769) at org.eclipse.birt.report.engine.executor.ExecutionContext.getDataEngine(ExecutionContext.java:791) at org.eclipse.birt.report.engine.executor.ReportExecutor.execute(ReportExecutor.java:119) at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.execute(WrappedReportExecutor.java:60) at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplciateReportExecutor.execute(SuppressDuplciateReportExecutor.java:52) at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.execute(WrappedReportExecutor.java:60) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:155) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:70) at org.eclipse.birt.report.tests.engine.BaseEmitter.runandrender_emitter(BaseEmitter.java:71) at org.eclipse.birt.report.tests.engine.api.IColumnTest.testIColumn(IColumnTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:574) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:556) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:511) at org.eclipse.equinox.launcher.Main.run(Main.java:1284) at org.eclipse.equinox.launcher.Main.main(Main.java:1260)

Files changed in fix:
core/org.eclipse.birt.core/src/org/eclipse/birt/core/framework/URLClassLoader.java