Bug 389564 - [patch] Url representing the absolute path of jars under Additional Tasks & support is not correct when those jars reside on a shared drive in a shared eclipse installation
Summary: [patch] Url representing the absolute path of jars under Additional Tasks & s...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 4.4.2   Edit
Hardware: PC Windows Server 2003
: P3 normal (vote)
Target Milestone: 4.5 M7   Edit
Assignee: Julian Enoch CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2012-09-13 17:47 EDT by Hamdan Msheik CLA
Modified: 2015-05-19 18:10 EDT (History)
5 users (show)

See Also:


Attachments
Ant jar path issue (161.88 KB, image/png)
2012-09-13 17:49 EDT, Hamdan Msheik CLA
no flags Details
Patch to fix ant plugins URL issue of with an eclipse shared install (14.93 KB, patch)
2012-11-13 10:59 EST, Hamdan Msheik CLA
no flags Details | Diff
Ant runtime preferences (740.83 KB, image/jpeg)
2015-04-28 08:19 EDT, Julian Enoch CLA
no flags Details
Ant prefs with the error log (611.37 KB, image/jpeg)
2015-04-28 09:25 EDT, Julian Enoch CLA
no flags Details
Ant exceptions and prefs (184.77 KB, image/png)
2015-04-28 09:33 EDT, Michael Rennie CLA
no flags Details
See the paths with a space in them (699.62 KB, image/jpeg)
2015-04-28 15:30 EDT, Julian Enoch CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hamdan Msheik CLA 2012-09-13 17:47:04 EDT
Environment: I have a windows server 2003 virtual machine that accesses a shared install of eclipse 3.7.1, 3.7.2, 3.8. The ".eclipse" directory is configured to be located on a shared drive. 

Problem: When running ant files using a separate jre set through (Run->External Tools->External Tools Configuration->JRE), eclipse takes a long time and eventually freezes. Alternatively, if you check the jar paths through eclipse ant run configuration (Run->External Tools->External Tools Configuration->Classpath->Additional Tasks & Support) you will find them missing a segment. Ex, say the file system absolute path of a jar is "\\hub\home\tom\.eclipse\3.8\configuration\org.eclipse.osgi\bundles\21\2\.cp\lib\remote.jar", then the path shown through eclipse ant run configuration will be "c:\home\tom\.eclipse\3.8\configuration\org.eclipse.osgi\bundles\21\2\.cp\lib\remote.jar". In short, the "\\hub" segment is replaced by "c:\" as you can see per the screen shot attached.
Comment 1 Hamdan Msheik CLA 2012-09-13 17:49:50 EDT
Created attachment 221066 [details]
Ant jar path issue
Comment 2 Hamdan Msheik CLA 2012-11-13 10:59:15 EST
Created attachment 223516 [details]
Patch to fix ant plugins URL issue of with an eclipse shared install
Comment 3 Eclipse Genie CLA 2015-02-26 13:19:49 EST
New Gerrit change created: https://git.eclipse.org/r/42824
Comment 4 Sarika Sinha CLA 2015-02-27 00:27:55 EST
(In reply to Eclipse Genie from comment #3)
> New Gerrit change created: https://git.eclipse.org/r/42824

Julian,
Can you please create the gerrit patch on master branch, We are done with 4.4.2 changes and SR2 is out.
Comment 5 Julian Enoch CLA 2015-02-27 09:30:04 EST
Sarika,

I am trying to provision the master branch using Oomph, but there are compilation errors in the workspace. Have you been able to do so lately? It looks like an issue with the version of org.eclipse.core.runtime
Comment 6 Eclipse Genie CLA 2015-02-27 10:04:54 EST
New Gerrit change created: https://git.eclipse.org/r/42911
Comment 7 Julian Enoch CLA 2015-03-16 11:24:56 EDT
Commit ready for review https://git.eclipse.org/r/42911
Thanks
Comment 8 Sarika Sinha CLA 2015-03-17 01:50:18 EDT
Thanks, Will be looking at them in 4.5 M7 as M6 is at the end.
Comment 9 Julian Enoch CLA 2015-03-23 16:28:23 EDT
That's alright. 
Thanks.
Comment 10 Sarika Sinha CLA 2015-03-31 07:10:08 EDT
Patch looks good, Can you add couple of test cases around this ?
Comment 11 Sarika Sinha CLA 2015-04-26 02:21:31 EDT
Julian,
Do you plan to add a testcase in Mars ?

Mike,
Looks good to me. Please review.
Comment 12 Julian Enoch CLA 2015-04-26 08:58:29 EDT
(In reply to Sarika Sinha from comment #11)
> Julian,
> Do you plan to add a testcase in Mars ?

Hi Sarika,

I can look into adding a testcase in Mars or SR1 (depending on my work load), but I would like the current patch to be merged in Mars for my users to have it as soon as possible.

At least I see that the code itself is covered by the current Junit tests, and for our specific use case, it has been tested successfully in an integrated environment.

Please let me know if you want me to open a separate ticket to track the testcase.

> Mike,
> Looks good to me. Please review.
Comment 13 Sarika Sinha CLA 2015-04-27 10:28:00 EDT
+1 for this patch.

Created Bug 465594 for adding testcase.
Comment 14 Michael Rennie CLA 2015-04-27 11:00:48 EDT
(In reply to Sarika Sinha from comment #13)
> +1 for this patch.
> 
> Created Bug 465594 for adding testcase.

Just opening the runtime preference page I am bombarded with a lot of errors like the following:

"The library "ant_tasks/pde-ant.jar" specified from "org.eclipse.pde.core" for the extraClasspathEntries extension does not exist"

accompanied by exceptions like:

"java.net.URISyntaxException: Illegal character in path at index 91: file:/C:/Users/mrennie/workspaces/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse 4.5/org.eclipse.osgi/2210/0/.cp/ant_tasks/pde-ant.jar
	at java.net.URI$Parser.fail(URI.java:2848)
	at java.net.URI$Parser.checkChars(URI.java:3021)
	at java.net.URI$Parser.parseHierarchical(URI.java:3105)
	at java.net.URI$Parser.parse(URI.java:3053)
	at java.net.URI.<init>(URI.java:588)
	at java.net.URL.toURI(URL.java:939)
	at org.eclipse.ant.core.AntCorePreferences.getClasspathEntryURL(AntCorePreferences.java:688)
	at org.eclipse.ant.core.AntCorePreferences.computeDefaultExtraClasspathEntries(AntCorePreferences.java:776)
	at org.eclipse.ant.core.AntCorePreferences.<init>(AntCorePreferences.java:219)
	at org.eclipse.ant.core.AntCorePlugin.getPreferences(AntCorePlugin.java:224)
	at org.eclipse.ant.internal.ui.preferences.AntTasksPage.initialize(AntTasksPage.java:131)
	at org.eclipse.ant.internal.ui.preferences.AntRuntimePreferencePage.createContents(AntRuntimePreferencePage.java:92)
	at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:241)
	at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1453)
	at org.eclipse.jface.preference.PreferenceDialog$13.run(PreferenceDialog.java:1220)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
	at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1212)
	at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:609)
	at org.eclipse.jface.preference.PreferenceDialog$9$1.run(PreferenceDialog.java:676)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:671)
	at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:877)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
	at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:874)
	at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1243)
	at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1269)
	at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:265)
	at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:259)
	at org.eclipse.jface.util.OpenStrategy$1$2.run(OpenStrategy.java:440)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
	at org.eclipse.jface.window.Window.open(Window.java:803)
	at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:211)
	at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:63)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4354)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1112)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:993)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
"

Steps:

1. start a target workspace
2. open the pref dialog and select Ant > Runtime
3. look in the error log.
Comment 15 Michael Rennie CLA 2015-04-27 11:17:37 EDT
(In reply to Michael Rennie from comment #14)
> (In reply to Sarika Sinha from comment #13)
> Steps:
> 
> 1. start a target workspace
> 2. open the pref dialog and select Ant > Runtime
> 3. look in the error log.

Even restoring defaults on the page did not help. Each time I start a target workspace and open the Ant runtime prefs I get all the log entries.
Comment 16 Julian Enoch CLA 2015-04-27 11:36:01 EDT
(In reply to Michael Rennie from comment #15)
> > Steps:
> > 
> > 1. start a target workspace
> > 2. open the pref dialog and select Ant > Runtime
> > 3. look in the error log.

I tried to reproduce by launching an eclipse workbench, but I am able to view Ant > Runtime preferences without any errors! Unless you give me more precisions to follow for step 1.
Comment 17 Sarika Sinha CLA 2015-04-28 01:51:28 EDT
(In reply to Julian Enoch from comment #16)
To clarify the step 1.
From your workspace create a new Run Configuration for Eclipse Application. this will launch a new Eclipse instance. Here we are getting exception when we try to visit Ant/Runtime Preferences.

Do you have any entries under Contributed Entries in Classpath tab of Ant/Runtime prefernce node ? We get exception for the entries listed here.
Comment 18 Julian Enoch CLA 2015-04-28 08:19:19 EDT
Created attachment 252845 [details]
Ant runtime preferences
Comment 19 Julian Enoch CLA 2015-04-28 08:19:58 EDT
(In reply to Sarika Sinha from comment #17)
> (In reply to Julian Enoch from comment #16)
> To clarify the step 1.
> From your workspace create a new Run Configuration for Eclipse Application.
> this will launch a new Eclipse instance. Here we are getting exception when
> we try to visit Ant/Runtime Preferences.
> 
> Do you have any entries under Contributed Entries in Classpath tab of
> Ant/Runtime prefernce node ? We get exception for the entries listed here.

Yes I do have such entries. (see attachment)
Comment 20 Sarika Sinha CLA 2015-04-28 08:59:21 EDT
So you don't see any entry in Error Logs when you select Runtime node ?
Comment 21 Julian Enoch CLA 2015-04-28 09:25:14 EDT
Created attachment 252849 [details]
Ant prefs with the error log

I really don't have errors linked to opening the preferences!
Comment 22 Michael Rennie CLA 2015-04-28 09:33:51 EDT
Created attachment 252851 [details]
Ant exceptions and prefs

Even with a brand new workspace I get the exceptions, using Java 7 / 8 (that shouldn't matter)
Comment 23 Julian Enoch CLA 2015-04-28 09:42:30 EDT
(In reply to Michael Rennie from comment #22)
> Created attachment 252851 [details]
> Ant exceptions and prefs
> 
> Even with a brand new workspace I get the exceptions, using Java 7 / 8 (that
> shouldn't matter)

I would like to find out how to solve this. But given that I can't reproduce it and that I am not very knowledgeable in your project, I will need your guidance.

Please advice on how I should tackle this.

Thanks,
Comment 24 Julian Enoch CLA 2015-04-28 11:02:57 EDT
I see this is due to direct conversion from URL to URI without handling unsafe characters, in your case the space in "Eclipse 4.5"

I am working on a fix.
Comment 25 Julian Enoch CLA 2015-04-28 15:30:17 EDT
Created attachment 252860 [details]
See the paths with a space in them

I was able to reproduce the problem after all by creating an installation in a location that has a space in the path. I received the same errors and the entries with the space wouldn't show up in the preferences.

The patch now uses the method org.eclipse.core.runtime.URIUtil.toURI() which suppresses the problems linked to unsafe characters during the conversion.
Comment 26 Julian Enoch CLA 2015-04-28 15:31:22 EDT
Problem fixed in https://git.eclipse.org/r/#/c/42911/
Comment 27 Julian Enoch CLA 2015-04-30 07:40:41 EDT
Hi Michael,
Sarika has reviewed the new change successfully (see bellow). I am waiting for yours (https://git.eclipse.org/r/#/c/42911/).
Thanks,

------------------------------
Sarika Sinha
Apr 29 2:27 AM
Patch Set 4: Code-Review+1 Verified+1
Works good now. There are no errors reported opening Ant/Runtime Preference node.
Comment 29 Sarika Sinha CLA 2015-04-30 15:03:43 EDT
As we have a rebuild request for M7, this will be a part of it.
Comment 30 Sarika Sinha CLA 2015-05-04 01:26:49 EDT
Julian, 
can you please verify this bug with the build (or later one)
http://download.eclipse.org/eclipse/downloads/drops4/I20150430-1445/
Comment 31 Julian Enoch CLA 2015-05-04 13:55:48 EDT
(In reply to Sarika Sinha from comment #30)
> Julian, 
> can you please verify this bug with the build (or later one)
> http://download.eclipse.org/eclipse/downloads/drops4/I20150430-1445/

I verified successfully against the build http://download.eclipse.org/eclipse/downloads/drops4/I20150503-2000/

Thanks
Comment 32 Sarika Sinha CLA 2015-05-04 21:36:51 EDT
Thanks Julian.
Comment 33 Julian Enoch CLA 2015-05-12 09:04:38 EDT
Could you please advise on how to change the author name in this commit from "ejuleno" to "Julian Enoch"?
Comment 34 Dani Megert CLA 2015-05-12 09:12:51 EDT
(In reply to Julian Enoch from comment #33)
> Could you please advise on how to change the author name in this commit from
> "ejuleno" to "Julian Enoch"?

That's not possible.
Comment 35 Eclipse Genie CLA 2015-05-19 18:07:05 EDT
New Gerrit change created: https://git.eclipse.org/r/48225