wakatime / eclipse-wakatime

Eclipse plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/eclipse
BSD 3-Clause "New" or "Revised" License
174 stars 16 forks source link

Plugin doesn't work in DBeaver 6.2.0 (CE) #30

Closed bierbo closed 3 years ago

bierbo commented 5 years ago

I have installed the plugin since DBeaver 5.x (I don't know when I began using it actually). Entering the API key was possible until 6.x (I think). I have tried entering API key again in Dbeaver 6.x. Nothing showed up.

The log give me the following stacktrace when clicking on "API Key" in menu:

!ENTRY org.eclipse.e4.ui.workbench 4 0 2019-09-13 08:27:22.249
!MESSAGE Command 'com.wakatime.eclipse.plugin.commands.menuCommand' failed
!STACK 0
org.eclipse.core.commands.ExecutionException: Exception occured when loading the handler
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:287)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:95)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:320)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:254)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:498)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:488)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)
    at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
    at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4131)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1056)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3944)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3547)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:635)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.jkiss.dbeaver.core.application.DBeaverApplication.start(DBeaverApplication.java:246)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
Caused by: org.eclipse.core.runtime.CoreException: Plug-in com.wakatime.eclipse.plugin was unable to load class com.wakatime.eclipse.plugin.MenuHandler.
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:212)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:198)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:934)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
    at org.eclipse.ui.internal.handlers.HandlerProxy.loadHandler(HandlerProxy.java:342)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:277)
    ... 42 more
Caused by: java.lang.ClassNotFoundException: Bei der automatischen Aktivierung des Produktpakets com.wakatime.eclipse.plugin (350) ist ein Fehler aufgetreten.
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:126)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:570)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:330)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:396)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:474)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:423)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:415)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:620)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:196)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:934)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
    at org.eclipse.ui.internal.WorkbenchPlugin.lambda$0(WorkbenchPlugin.java:288)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:55)
    at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:286)
    at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:55)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.ui.internal.Workbench$39.run(Workbench.java:2719)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.osgi.framework.BundleException: Error starting module.
    at org.eclipse.osgi.container.Module.doStart(Module.java:607)
    at org.eclipse.osgi.container.Module.start(Module.java:462)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493)
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
    ... 20 more
Caused by: java.lang.ExceptionInInitializerError
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:825)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:778)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1013)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
    at org.eclipse.osgi.container.Module.doStart(Module.java:598)
    ... 23 more
Caused by: java.lang.NullPointerException
    at com.wakatime.eclipse.plugin.WakaTime.<clinit>(WakaTime.java:68)
    ... 32 more

Additional information: Used Plugin version: 3.0.3 Installed by: Update site URL

rolivares commented 4 years ago

I'm using v7.x and the issue is still present :( and I spend a lot of time in DBveaber

larmstrong commented 4 years ago

Also in v7 (Enterprise). Hitting the API Key option yields nada. :(

melizeche commented 3 years ago

+1 having this would be awesome

alanhamlett commented 3 years ago

Same as #33. Will work to fix this today.

It's reproducible in DBeaver, but works fine in Eclipse. The java.lang.NullPointerException occurs on startup and causes the api key menu handler to not be defined.

The java.lang.NullPointerException exception occurs from this code:

Platform.getBundle("org.eclipse.platform")

alanhamlett commented 3 years ago

Fixed in the release today v3.0.4.