Community
Participate
Working Groups
This bug shows up with spaces (e.g. C:/Program Files/TomcatX) in the installation directory of the web container (e.g. Apache Tomcat). Having a server application with a fragment hanging on the system.bundle the CloseableURLClassLoader is not able to find any class of the fragment. To reproduce: fragment (host: system.bundle) AClass plugin (any) Activator{ start(){ Class.forName("myfragment.AClass"); } } Export the application as war file and deploy it on a web container. With no spaces in the web container installation dir the class got resolved. With spaces in the installation dir a ClassNotFound exception occurs.
Created attachment 210511 [details] Proposed patch After a shot analysis I came up with the attached patch. The CloseableURLClassLoader:safeAddLoader(URL url) is called with (url.getPath()): - "C:/Program Files/tomcat/work/Catalina/localhost/testapp/eclipse/plugins/org.eclipse.osgi_XXX.jar" - "C:/Program%20Files/tomcat/work/Catalina/localhost/testapp/eclipse/plugins/myFrament_XXX.jar" - ...
Thanks for the patch! Will look to release a fix in M6.
Good catch Andreas. Thanks. URL encoding in Java is truly a horrible problem. What you have might be fine but it would be a good idea to also take a look at org.eclipse.core.runtime.URIUtil to ensure corner cases are covered as well.
Not going to make M6. (In reply to comment #3) > Good catch Andreas. Thanks. > > URL encoding in Java is truly a horrible problem. What you have might be fine > but it would be a good idea to also take a look at > org.eclipse.core.runtime.URIUtil to ensure corner cases are covered as well. I have an alternative patch that takes this into account. But I am not well equipped to test this out in time for M6.
Created attachment 212486 [details] alternative patch
Sorry, I am not confident in releasing this patch without additional review and testing by others that are more familiar with using and testing the servlet bridge. If I don't get that by the end of this week this bug will have to get deferred.
Moving out of the Juno release to SR1.
I'm going to release this for M5 Kepler.
Patch released for Kepler M7: http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=1abecd574ff7536e7e50b74b4686921f44249723
While doing a "local test build", I saw compile errors likely related to this change ... my local build just finished, so don't think it's a mere timing issue. I've not looked closer if "prereqs" changed? Or something? [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.17.0:compile (default-compile) on project org.eclipse.equinox.servletbridge: Compilation failure: Compilation failure: [ERROR] /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java:[182,0] [ERROR] File file = new File(toURI(url)); [ERROR] ^^^^^ [ERROR] The method toURI(URL) from the type CloseableURLClassLoader refers to the missing type URI [ERROR] /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java:[191,0] [ERROR] } catch (URISyntaxException e1) { [ERROR] ^^^^^^^^^^^^^^^^^^ [ERROR] URISyntaxException cannot be resolved to a type [ERROR] /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java:[198,0] [ERROR] private static URI toURI(URL url) throws URISyntaxException { [ERROR] ^^^ [ERROR] URI cannot be resolved to a type [ERROR] /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java:[198,0] [ERROR] private static URI toURI(URL url) throws URISyntaxException { [ERROR] ^^^^^^^^^^^^^^^^^^ [ERROR] URISyntaxException cannot be resolved to a type [ERROR] /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java:[211,0] [ERROR] return new URI(SCHEME_FILE, null, pathString, null); [ERROR] ^^^ [ERROR] URI cannot be resolved to a type
I did not realize org.eclipse.equinox.servletbridge still required foundation 1.0 as an EE. I bumped it up to foundation 1.1 / Java 1.4 http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=6cbfe68501fbc775691c97c19c624145b88718a2
Perhaps unrelated to this bug and change, but while trying to verify it with a local build, I am getting compile errors in test related bundles? [INFO] Building jar: /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.weaving.caching.j9/target/org.eclipse.equinox.weaving.caching.j9-1.0.200-SNAPSHOT.jar [INFO] Building jar: /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.bidi.tests/target/org.eclipse.equinox.bidi.tests-1.0.0-SNAPSHOT.jar [INFO] Building jar: /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.bundles/bundles/org.eclipse.equinox.cm.test/target/org.eclipse.equinox.cm.test-1.0.0.jar [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.17.0:compile (default-compile) on project org.eclipse.osgi.tests: Compilation failure: Compilation failure: [ERROR] /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.framework/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/securityadmin/SecurityManagerTests.java:[99,0] [ERROR] Map<String, Object> configuration = new HashMap<String, Object>(); [ERROR] ^^^^^^^^^^^^^^ [ERROR] Syntax error, parameterized types are only available if source level is 1.5 or greater [ERROR] /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.framework/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/securityadmin/SecurityManagerTests.java:[99,0] [ERROR] Map<String, Object> configuration = new HashMap<String, Object>(); [ERROR] ^^^^^^^^^^^^^^ [ERROR] Syntax error, parameterized types are only available if source level is 1.5 or greater [ERROR] /data/shared/eclipse/builds/4I/master/gitCache/eclipse.platform.releng.aggregator/rt.equinox.framework/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/securityadmin/SecurityManagerTests.java:[135,0] .... [many more]
(In reply to comment #12) > Perhaps unrelated to this bug and change, but while trying to verify it with > a local build, I am getting compile errors in test related bundles? > This is related to bug 386298.