I'm using Eclipse Luna Service Release 2 (4.4.2) and Eclipse Checkstyle plug-in 6.4.0.201503042206. I have a project with Checkstyle enabled and for every file I open I get a popup error with the following text:
An error has occurred. See error log for more details.
org/eclipse/ui/part/FileEditorInput
The Error Log view provides the following details:
An internal error occurred during: "Checking files...".
java.lang.NoClassDefFoundError: org/eclipse/ui/part/FileEditorInput
at net.sf.eclipsecs.ui.properties.filter.CheckFileOnOpenPartListener.getEditorFile(CheckFileOnOpenPartListener.java:234)
at net.sf.eclipsecs.ui.properties.filter.CheckFileOnOpenPartListener.access$0(CheckFileOnOpenPartListener.java:209)
at net.sf.eclipsecs.ui.properties.filter.CheckFileOnOpenPartListener$PartsOpenedJob.runInWorkspace(CheckFileOnOpenPartListener.java:111)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
I tried restarting Eclipse with the -clean option with no change in behavior.
Hi, I just tried to reproduce this on a fresh Luna SR2 and eclipse-cs-6.4.0 but couldn't. The "files not opened in editor" filter worked as expected for me.
I suppose something is off with the plugin installation in your case, I'd try uninstalling, clean restart and then re-installing.
HTH,
Lars
I have some other plugins installed so I spent some time trying to figure out if one of them was causing a conflict. Sure enough, it appears that Google CodePro AnalytiX (https://developers.google.com/java-dev-tools/download-codepro) is causing the problem.
I'm using (the admittedly rather old, but most recent) update site http://dl.google.com/eclipse/inst/codepro/latest/3.7. If I install, say, CodePro - Core and restart Eclipse, the popup error mentioned in the description occurs for every file I open. If I uninstall CodePro - Core, the error goes away and the Eclipse Checkstyle plug-in behaves normally.
So the simple solution is to stop using CodePro. It hasn't been updated in years and appears to be a dead project. However, if it's not too much to ask, I was hoping it might be possible to find some workaround for this issue. CodePro has some nice features that I'd like to continue using. And as a side note, this error did not occur with Eclipse Checkstyle plug-in 6.2 with CodePro installed.
I understand if this request is out of scope.
I should also mention that I did try uninstalling Eclipse Checkstyle, restarting, and then re-installing Eclipse Checkstyle. This did not resolve the problem.
I installed CodePro into my Eclipse Luna instance and gave it a quick spin.
Hoewever, I still could not reproduce the issue.
Not that I think it should make any difference, but the order how I did things was:
1. Install a fresh Luna SR2
2. Install eclipse-cs
3. Install CodePro Analytix for Indigo
I have seen this issue after luna sr2 update as well, after uninstalling codepro and eclipse-cs and installing eclipse-cs and then codepro, everything works again.
(previously some features from codepro disappeared, probably after the update to the first version of luna, so something is probably broken in the setup of the codepro packages?).
Anyway, it works now, thanks.
Hmm, uninstalling eclipse-cs and CodePro and then re-installing did not work for me. I've tried a bunch of different combinations of uninstalling/re-installing without success. I even tried updating to the latest Mars milestone with no change in behavior.
Is there a way to turn off the CheckFileOnOpenPartListener? For example, it would be sufficient in my case to only invoke the Checkstyle rules on a save action (not when an editor opens).
Hmm, that's a pity that it didn't work for you.
CheckFileOnOpenPartListener is part of the "unopened files filter" functionality. If you disable this filter option in your project properties it will not be active.
However, given the strange nature of the bug you're seeing I am not sure if other plugin functionality won't be affected as well...
Thanks. I still get the error even if the "files not opened in editor" filter is disabled in the project properties.
This is a horrible hack, but I finally just downloaded the source and modified CheckFileOnOpenPartListener around line 234 to this:
try { if (input instanceof FileEditorInput) { file = ((FileEditorInput) input).getFile(); } } catch (NoClassDefFoundError e) { return file; }I then replaced the CheckFileOnOpenPartListener.class in Eclipse\plugins\net.sf.eclipsecs.ui_6.4.0.201503042206\net\sf\eclipsecs\ui\properties\filter with the modified version.
After restarting Eclipse, the error no longer occurs and all other plugin functionality appears to be working fine. Weird.
Good news, I upgraded to Eclipse Neon and I no longer see this error. Feel free to close this issue.
Closing for housekeeping.