Ericsson / CodeCheckerEclipsePlugin

This is an Eclipse plugin that shows C/C++ static analysis results found by Clang Static Analyzer and Clang Tidy
Eclipse Public License 1.0
32 stars 13 forks source link

exception thrown at file change #73

Closed dkrupp closed 7 years ago

dkrupp commented 8 years ago

When I change file in the editor part i get the following exception in a popup in eclipse:

An error has occurred. See error log for more details. cc.codechecker.api.runtime.CodeCheckEnvironmentChecker.isJavaRunner(I)Z

whisperity commented 8 years ago

This issue is more general than initially thought. Simply clicking into the EditorPart makes it throw an exception, even if this click is the very first click since Eclipse was started.

The error log, however, doesn't show anything apart from this:

[Usual stuff of loading and starting threads] Three checker commands started (I have three projects set up) 2 CodeChecker outputs, one project is configured not to run any checkers 2016-08-23 10:39:30 Thread-14 DEBUG CodeCheckerContext:152 - SERVER_GUI_MSG >> CLEARING CACHE 2016-08-23 10:39:30 main INFO ReportListView:286 - SERVER_GUI_MSG >> PreChanging runList! 2016-08-23 10:39:30 main DEBUG Filter:33 - SERVER_GUI_MSG >> filePath : * checkerMsg: severity: ANY checkerId: buildTarget: showSuppressedErrors: false 2016-08-23 10:39:31 Thread-16 DEBUG CodeCheckerContext:152 - SERVER_GUI_MSG >> CLEARING CACHE 2016-08-23 10:39:31 main INFO ReportListView:286 - SERVER_GUI_MSG >> PreChanging runList! 2016-08-23 10:39:31 main DEBUG Filter:33 - SERVER_GUI_MSG >> filePath : * checkerMsg: severity: ANY checkerId: buildTarget: showSuppressedErrors: false 2016-08-23 10:39:43 main DEBUG EditorPartListener:23 - SERVER_GUI_MSG >> Editor changed : org.eclipse.cdt.internal.ui.editor.CEditor

Eclipse Error Report's output for this problem:

Exception:java.lang.NoSuchMethodError: cc.codechecker.api.runtime.CodeCheckEnvironmentChecker.isJavaRunner(I)Z at cc.codechecker.plugin.config.CcConfiguration.isConfigured(CcConfiguration.java:217) at cc.codechecker.plugin.config.CodeCheckerContext.refreshChangeEditorPart(CodeCheckerContext.java:213) at cc.codechecker.plugin.init.EditorPartListener.partActivated(EditorPartListener.java:24) at org.eclipse.ui.internal.WorkbenchPage$14.run(WorkbenchPage.java:4977) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.WorkbenchPage.firePartActivated(WorkbenchPage.java:4974) at org.eclipse.ui.internal.WorkbenchPage.access$19(WorkbenchPage.java:4962) at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partActivated(WorkbenchPage.java:210) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$3.run(PartServiceImpl.java:250) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartActivated(PartServiceImpl.java:247) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:757) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:682) at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:95) at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.handleEvent(ContributedPartRenderer.java:63) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5219) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1340) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1366) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1349) at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1817) at org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3215) at org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3151) at org.eclipse.swt.widgets.Composite.gtk_button_press_event(Composite.java:750) at org.eclipse.swt.widgets.Canvas.gtk_button_press_event(Canvas.java:155) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1979) at org.eclipse.swt.widgets.Control.windowProc(Control.java:5819) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5490) at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(OS.java:-2) at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:9545) at org.eclipse.swt.widgets.Display.eventProc(Display.java:1275) at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(OS.java:-2) at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2495) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4141) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) 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:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610) at org.eclipse.equinox.launcher.Main.run(Main.java:1519) at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

whisperity commented 8 years ago

This issue is caused by dynamic dependency resolution — namely the dependency API library was not recompiled with the changes in #72 if the system was already configured — a flaw or misconfiguration in the build toolchain.

This issue is solved by fully recompiling and reinstalling the eclipse plugin:

  1. Delete the compiled plugin from the eclipse/dropins folder and start Eclipse.
  2. Switch to a perspective different than CodeChecker, and delete the perspective itself.
  3. Go to eclipse-plugin in the checked out working directory and execute git ls-files -o -i --exclude=standard | xargs rm. This will remove every compiled JAR file.
  4. Rebuild the project with mvn package.
  5. Copy the plugin to the dropins directory and start Eclipse.
  6. If there are two perspectives, <CodeChecker> and CodeChecker, you need to go to Window > Preferences > General > Perspectives and Delete the <CodeChecker> one.
  7. Add the perspective and the issue should be solved — it may require an Eclipse restart.