Archive

Archive for the ‘Eclipse’ Category

java.lang.IllegalStateException: Registry Directory not available.

22 February 2010 2 comments

I just spent two hours trying to figure out why I was getting the following exception after I had installed FindBugs eclipse plugin. Everytime I was going to Help->Software Updates… eclipse was reporting the following error

java.lang.IllegalStateException: Registry Directory not available.
	at org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry.restore(SimpleProfileRegistry.java:330)
	at org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry.getProfileMap(SimpleProfileRegistry.java:223)
	at org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry.internalGetProfile(SimpleProfileRegistry.java:180)
	at org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry.getProfile(SimpleProfileRegistry.java:171)
	at org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil.getProfile(ProvisioningUtil.java:161)
	at org.eclipse.equinox.internal.p2.ui.sdk.ProvSDKUIActivator.getSelfProfileId(ProvSDKUIActivator.java:169)
	at org.eclipse.equinox.internal.p2.ui.sdk.UpdateHandler.execute(UpdateHandler.java:41)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:281)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:247)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:619)
	at org.eclipse.ui.menus.CommandContributionItem.access$10(CommandContributionItem.java:605)
	at org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(CommandContributionItem.java:595)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	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:386)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

Looking at forums and mailing lists didn’t help. But at the end I found out that somehow Eclipse’s config.ini was mixed up after the update. It seems that the eclipse.p2.data.area property was pointing to the wrong directory. Below is the updated config.ini (with # is the old entry which I commented out)

#eclipse.p2.data.area=@config.dir/C\:\\java\\ganymede-jboss-tools\\eclipse-ganymede\\p2\\
eclipse.p2.data.area=file://C:/java/ganymede-jboss-tools/eclipse-ganymede/p2/

I got a hint while I was looking at this line

URL registryURL = new URL(agent.getDataArea(EngineActivator.ID), STORAGE_DIR);

at SimpleProfileRegistry‘s source code.

Lets hope that next time the equinox developers will be smarter and more informative about the error messages. Merely saying that “Registry Directory not available.” without saying what is a “registry directory” or which directory is not available does not help at all.

Advertisements
Categories: Eclipse Tags: , , ,