Bug 120120 - Import user libraries not working
Summary: Import user libraries not working
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 160227 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-09 11:26 EST by Roger Stocker CLA
Modified: 2009-08-30 02:06 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Stocker CLA 2005-12-09 11:26:58 EST
Since Version 3.1.1 I cannot import user libraries anymore. If I go to Windows->Preferences->Java->BuildPath->User libraries and press the import button, then NOTHING happens.
Comment 1 Roger Stocker CLA 2005-12-09 11:30:56 EST
Ok, after exporting the libraries once, the import is working again... It seems to happen only after upgrading from 3.1 to 3.11 before the first export.
Comment 2 Frederic Fusier CLA 2005-12-09 11:47:37 EST
Can you look at .log to see if there were anything reported during your first import?
Comment 3 Olivier Thomann CLA 2006-10-10 15:33:42 EDT
Closing as REMIND.
Reopen once the requested information is provided.
Comment 4 Kelly Davis CLA 2006-12-06 10:25:12 EST
This is occuring for me on 3.2.1 (Build M20060921-0945). I running the AMD 64 Linux version. Here what is in the log file when I click the Import button:

!ENTRY org.eclipse.ui 4 0 2006-12-06 10:43:09.681
!MESSAGE assertion failed: Path for IClasspathEntry must be absolute
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: assertion failed: Path for IClasspathEntry must be absolute
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
	at org.eclipse.jdt.core.JavaCore.newLibraryEntry(JavaCore.java:3385)
	at org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement.newClasspathEntry(CPListElement.java:175)
	at org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement.getClasspathEntry(CPListElement.java:142)
	at org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement.equals(CPListElement.java:386)
	at java.util.ArrayList.indexOf(ArrayList.java:220)
	at java.util.ArrayList.contains(ArrayList.java:201)
	at org.eclipse.jdt.internal.ui.wizards.buildpaths.CPUserLibraryElement.add(CPUserLibraryElement.java:115)
	at org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage$LoadSaveDialog.loadLibraries(UserLibraryPreferencePage.java:668)
	at org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage$LoadSaveDialog.updateShownLibraries(UserLibraryPreferencePage.java:374)
	at org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage$LoadSaveDialog.dialogFieldChanged(UserLibraryPreferencePage.java:398)
	at org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField.dialogFieldChanged(DialogField.java:70)
	at org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField.setText(StringDialogField.java:162)
	at org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage$LoadSaveDialog.<init>(UserLibraryPreferencePage.java:300)
	at org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage.doLoad(UserLibraryPreferencePage.java:1120)
	at org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage.doCustomButtonPressed(UserLibraryPreferencePage.java:1014)
	at org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage$UserLibraryAdapter.customButtonPressed(UserLibraryPreferencePage.java:1279)
	at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.buttonPressed(TreeListDialogField.java:167)
	at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.doButtonSelected(TreeListDialogField.java:385)
	at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.access$2(TreeListDialogField.java:381)
	at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField$2.widgetSelected(TreeListDialogField.java:346)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3166)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2842)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3166)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2842)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	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.core.launcher.Main.invokeFramework(Main.java:336)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 5 Olivier Thomann CLA 2006-12-06 10:29:43 EST
Could you please provide steps to reproduce?
Comment 6 Kelly Davis CLA 2006-12-06 13:02:15 EST
Well after attempting to reproduce this, it looks like my bug is similar, but may not be the same as the one originally reported. Basically I was trying to figure out how to put a classpath variable reference in a user libraries file. I tried VARIABLE_NAME, $VARIABLE_NAME, and ${VARIABLE_NAME}, but tone of these seems to be valid. (I did some extensive searching for how to do this and as yet don't know if it is possible.) So apparently, what happens is that if you have a userlibraries file with multiple bad entries, and you attempt to import it, you can somehow wedge Eclipse so that you can no longer import ANY new user libraries. Here's how to reproduce it.

1. Start Eclipse with a new clean workspace
2. Go to Window, Preferences, Java, Build Path, User Libraries
3. Click Import, Browse to test.user_libraries which should be something like:

<?xml version="1.0" encoding="UTF-8"?>
<eclipse-userlibraries version="2">
<library name="bad_userlibrary" systemlibrary="false">
<archive path="BAD_PATH/activation.jar"/>
<archive path="BAD_PATH/mail.jar"/>
</library>
</eclipse-userlibraries>

4. Click Ok, Results frame goes gray and OK button becomes disabled.
5. Now hit cancel and try clicking Import.. again. Nothing happens. Closing eclipse and restarting does not fix it. Deleting the workspace does fix it.

If I only have one bad entry in the userlibraries file, I get an error message saying that the path needs to be absolute, but more than one gives the behavior above. This may be what happened to the original reporter, but it isn't clear from the description.
Comment 7 Kelly Davis CLA 2006-12-06 13:12:04 EST
Ok looks like the behavior I am describing is in bug #160227.
Comment 8 Olivier Thomann CLA 2006-12-06 13:22:15 EST
*** Bug 160227 has been marked as a duplicate of this bug. ***
Comment 9 Denis Roy CLA 2009-08-30 02:06:14 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.