【エラー】Could not initialize class net.sf.eclipsecs.core.config.meta.MetadataFactory(最新バージョンEclipseのCheckstyleが使えない)


最新版(2021-03)のEclipseをインストールしたら
Checkstyleが使えなくなりました。

環境

Windows10
Eclipse2021-03(Pleiadesでインストール)
Checkstyleプラグイン 8.42

実行内容

① JAVAファイルに対してCheckstyleでコードチェック(Google Checks)

処理結果

!ENTRY org.eclipse.jface 4 2 2021-06-03 11:12:03.270
!MESSAGE プラグイン "org.eclipse.jface" からのコードの起動で問題が発生しました。
!STACK 0
java.lang.NoClassDefFoundError: Could not initialize class net.sf.eclipsecs.core.config.meta.MetadataFactory
       at net.sf.eclipsecs.core.config.ConfigurationReader$1.visit(ConfigurationReader.java:167)
       at org.dom4j.tree.AbstractElement.accept(AbstractElement.java:174)
       at org.dom4j.tree.AbstractDocument.accept(AbstractDocument.java:112)
       at net.sf.eclipsecs.core.config.ConfigurationReader.getModules(ConfigurationReader.java:158)
       at net.sf.eclipsecs.core.config.ConfigurationReader.read(ConfigurationReader.java:146)
       at net.sf.eclipsecs.core.config.CheckConfigurationWorkingCopy.getModules(CheckConfigurationWorkingCopy.java:240)
       at net.sf.eclipsecs.ui.config.CheckConfigurationConfigureDialog.initialize(CheckConfigurationConfigureDialog.java:447)
       at net.sf.eclipsecs.ui.config.CheckConfigurationConfigureDialog.createDialogArea(CheckConfigurationConfigureDialog.java:216)
       at org.eclipse.jface.dialogs.TitleAreaDialog.createContents(TitleAreaDialog.java:157)
       at org.eclipse.jface.window.Window.create(Window.java:431)
       at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1094)
       at net.sf.eclipsecs.ui.config.CheckConfigurationConfigureDialog.create(CheckConfigurationConfigureDialog.java:226)
       at org.eclipse.jface.window.Window.open(Window.java:788)
       at net.sf.eclipsecs.ui.config.CheckConfigurationWorkingSetEditor.configureCheckConfig(CheckConfigurationWorkingSetEditor.java:518)
       at net.sf.eclipsecs.ui.config.CheckConfigurationWorkingSetEditor.access$6(CheckConfigurationWorkingSetEditor.java:505)
       at net.sf.eclipsecs.ui.config.CheckConfigurationWorkingSetEditor$PageController.doubleClick(CheckConfigurationWorkingSetEditor.java:429)
       at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:782)
       at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
       at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
       at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:779)
       at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:1100)
       at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1213)
       at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:251)
       at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:249)
       at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:308)
       at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
       at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4209)
       at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1043)
       at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4026)
       at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3626)
       at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
       at org.eclipse.jface.window.Window.open(Window.java:799)
       at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:66)
       at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
       at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
       at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
       at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
       at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4209)
       at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1043)
       at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4026)
       at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3626)
       at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
       at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
       at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
       at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
       at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
       at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
       at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
       at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
       at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
       at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
       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:401)
       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(NativeMethodAccessorImpl.java:62)
       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.base/java.lang.reflect.Method.invoke(Method.java:566)
       at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
       at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
       at org.eclipse.equinox.launcher.Main.run(Main.java:1461)

解決策

バージョンを落とす

根本的な解決策ではないですが、
2020-12のバージョンに落としたら使えるようになりました。

sun checksも、カスタマイズのchecksも使えなかったので、
バージョンアップで何かが削られたのか、自分の設定が悪かったのか...
MetadataFactoryをどうにかできたらいいのかな...

でも最新版使いたいので、
どうにか使えるようにできないか空き時間で見ていきたいと思います。

この記事が気に入ったらサポートをしてみませんか?