Eclipse exception when opening Connect IQ SDK Manager

I was using the Connect IQ SDK Manager in Eclipse last week to try to download the 1.1.1 SDK but was having issues downloading it through there, so I downloaded it manually through the Garmin developer site and tried to add it with the SDK Manager. Somehow (I'm unsure how) I didn't get it working and I got into a state where I cannot launch the SDK Manager. Attempting to results in the NullPointerException below. For now, is there any "easy" method besides maybe reinstalling Eclipse and completely blowing away my preferences that I could resolve this? Thanks for any assistance.


Unhandled event loop exception

org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:62)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:825)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:701)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$6(HandledContributionItem.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:613)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
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$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
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(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: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)
Caused by: java.lang.NullPointerException
at com.garmin.connectiq.sdkmanager.dialog.SdkManagerDialog.updateSdkList(SdkManagerDialog.java:429)

at com.garmin.connectiq.sdkmanager.dialog.SdkManagerDialog.<init>(SdkManagerDialog.java:105)
at com.garmin.connectiq.sdkmanager.handlers.SdkManagerHandler.execute(SdkManagerHandler.java:32)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
... 38 more
  • Former Member
    Former Member over 10 years ago
    Hopefully you only need to restore settings to the default value. If you go to your workspace location on disk, look for a directory `.metadata/.plugins/org.eclipse.core.runtime/.settings/` and there you should find two files starting with IQ_, something like IQ_SdkManager.prefs. You can peek inside and see if anything looks wrong, but it's safe to just delete them and restart Eclipse.

    If nothing works, just switch to a new workspace (you'll "lose" your preferences but it's faster than re-installing.. which won't help if you reuse the workspace directory).
  • Former Member
    Former Member over 10 years ago
    It looks like a file IO issue is happening. The line in question will only have a null value if the file that's being read isn't a directory (there's already a check for that) or a IO error occurs. I've added a null check to handle the second case but I'm not sure what would cause the IO error in the first place.

    On a side note, you won't be able to manually download a SDK and have the SDK manager recognize it (well I guess you could but it'll take some work). When the SDK manager downloads and unzips a SDK it puts a hidden file with some context inside the SDK directory. The SDK manager needs that file to be able to detect an SDK is there. If you manually download a SDK you'll want to go into the Connect IQ preferences (Preferences > Connect IQ > SDK Root Directory) and set the SDK path there.
  • jaguarul80, thanks for helping me toward those preference files; my filesystem search was a little off and I wasn't finding them. I've corrected the paths in those files, and after changing my SDK path to be correct I am able to load the SDK Manager in Eclipse without exception.

    Thank you for putting a fix in Ken. I think the issue may have been a permissions issue, as my SDK directory was in my Program Files directory on Windows 7. I've moved the SDK's to a directory under my user directory and after setting the path in the preference file I get no error (and now I can download the 1.1.1 SDK).

    Now, back to coding!