-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InvalidRegistryObjectException in Eclipse when using older Groovy compiler/runtime #317
Comments
Has the problem persisted beyond closing all editors and restarting Eclipse? |
The problem still exists, do the following steps:
After uninstall greclipse, the problem will be fine. |
I have updated greclipse, created a new worskpace and checked out my projects. If i leave eclipse with editors left opened, i still get this error in the opened editors and the package explorer after restart. |
I'm seeing the same issue on Eclipse Oxygen . Had to uninstall greclipse for now. |
The problem is, that my team kind of needs the plugin. So we have to stick to Neon for now. |
Could you tell me which packaging of Oxygen and what extra plug-ins you use? I have been using Oxygen since about M3 and not run into this issue. I cannot add logging easily since the error comes from low-level Eclipse plug-in services.
|
Sure. Like that? eclipse.buildId=4.7.0.I20170612-0950 |
Do you have an update site link for the JavaHL features? I do not see them on the Oxygen update site.
|
I must still be missing something. I have Eclipse IDE for Java Developers (Win64) + Subversion + Greclipse. I created a Groovy and a Java project and added one class. I left the editors open and restarted eclipse. Everything came up properly. The editors that are failing to load, are they for sources from a Maven project? Is the project under SVN source control? Can you provide me a zip of a very minimal project that displays this behavior? |
Must be one of the projects in my workspace. i try checking them out one by one. |
@tobiasreimer Also, if you have any special steps that your team must run through to enable stuff in the workspace, those may be relevant. You mention above that you created a new workspace. Did you need to set any preferences or did you import settings from another workspace? |
In your original screenshot, I see errors "Problems occurred when invoking code from plug-in: 'org.eclipse.ui.workbench'." Do you still have those errors in your log. Can you share the details of one of them?
Eclipse is trying to execute "IFile file= editorInput.getAdapter(IFile.class)" and this is in turn trying to load extension points that provide adaptation implementations. I'm not sure which adapter is failing to load but there may be logging around that stuff.
In my eclipse instance, org.eclipse.ui.part.FileEditorInput maps to {
org.eclipse.jdt.core.IjavaElement = AdapterFactoryProxy [contributor: org.eclipse.jdt.ui[5271], adaptableType: org.eclipse.ui.IEditorInput],
org.codehaus.groovy.ast.ClassNode = AdapterFactoryProxy [contributor: org.codehaus.groovy.eclipse.ui[3019], adaptableType: org.eclipse.ui.IFileEditorInput],
org.eclipse.search.ui.IsearchPageScoreComputer = AdapterFactoryProxy [contributor: org.eclipse.jdt.ui[5271], adaptableType: org.eclipse.ui.IEditorInput],
org.eclipse.core.resources.Iresource = AdapterFactoryProxy [contributor: org.eclipse.ui.ide[5328], adaptableType: org.eclipse.ui.IFileEditorInput, factory: org.eclipse.ui.internal.ide.model.FileInputAdapterFactory@55feda3f<mailto:org.eclipse.ui.internal.ide.model.FileInputAdapterFactory@55feda3f>],
org.eclipse.ui.IpathEditorInput = AdapterFactoryProxy [contributor: org.eclipse.ui.ide[5328], adaptableType: org.eclipse.ui.IURIEditorInput],
org.eclipse.core.resources.Ifile = AdapterFactoryProxy [contributor: org.eclipse.ui.ide[5328], adaptableType: org.eclipse.ui.IFileEditorInput, factory: org.eclipse.ui.internal.ide.model.FileInputAdapterFactory@55feda3f<mailto:org.eclipse.ui.internal.ide.model.FileInputAdapterFactory@55feda3f>],
org.eclipse.ui.editors.text.IlocationProvider = AdapterFactoryProxy [contributor: org.eclipse.ui.editors[5324], adaptableType: org.eclipse.ui.IURIEditorInput],
org.eclipse.debug.ui.actions.Ilaunchable = AdapterFactoryProxy [contributor: org.eclipse.debug.ui[5161], adaptableType: org.eclipse.ui.part.FileEditorInput]
}
|
Groovy-Eclipse makes the following contributions to the adapters extension point: <extension point="org.eclipse.core.runtime.adapters">
<factory
adaptableType="org.eclipse.core.resources.IFile"
class="org.codehaus.groovy.eclipse.core.adapters.GroovyFileAdapterFactory">
<adapter
type= "org.codehaus.groovy.ast.ClassNode"
/>
<adapter
type="[Lorg.codehaus.groovy.ast.ClassNode;"
/>
</factory>
</extension>
<extension point="org.eclipse.core.runtime.adapters">
<factory
adaptableType="org.codehaus.groovy.eclipse.editor.GroovyEditor"
class="org.codehaus.groovy.eclipse.quickfix.templates.SurroundWithAdapterFactory">
<adapter
type="org.codehaus.groovy.eclipse.quickfix.templates.SurroundWithAdapterFactory"
/>
</factory>
</extension>
<extension point="org.eclipse.core.runtime.adapters">
<factory
adaptableType="org.eclipse.ui.IFileEditorInput"
class="org.codehaus.groovy.eclipse.adapters.GroovyIFileEditorInputAdapterFactory">
<adapter
type="org.codehaus.groovy.ast.ClassNode"
/>
</factory>
<factory
adaptableType="org.codehaus.groovy.eclipse.editor.GroovyEditor"
class="org.codehaus.groovy.eclipse.adapters.GroovyEditorAdapterFactory">
<adapter
type="org.codehaus.groovy.ast.ModuleNode"
/>
</factory>
<factory
adaptableType="org.codehaus.groovy.eclipse.editor.GroovyEditor"
class="org.codehaus.groovy.eclipse.debug.ui.GroovyRetargettableActionAdapterFactory">
<adapter
type="org.eclipse.debug.ui.actions.IToggleBreakpointsTarget"
/>
</factory>
</extension>
|
sure...
|
a small 'workaround'? allow to start oxygen correctly... but then at eclipse closing the prefs it's written incorrectly :( maybe lock a 0 size file will do the trick!? |
That's an interesting lead. Can you send the prefs file so I can see how it looks compared to what I have?
|
Bingo! I get the same issue once the compiler resolver writes out a settings and therefore does uts OSGi magic to select a new runtime bundle during startup.
|
If it's still useful.. here's my 'corrupted' file org.codehaus.groovy.eclipse.compilerResolver.zip i'm on windows 10 x64 got the problem with both oxygen java & jee running on latest jvm 1.8.131 but using 1.7 for a bounch of gradle project |
Nothing wrong with your file. The chooser service has an issue. Just as an FYI, the highest Groovy version installed will be used. So if 2.4 is your desire and you do not have 2.5 installed, you do not need this prefs file.
|
So here's what I know so far. The CompilerChooser is getting run and is making sure the Groovy 2.4 is the active one. It uninstalls any other Groovy bundle versions you have (2.3 in this case). Then it uses PackageAdmin to refresh the OSGi state because the exported packages for Groovy could have changed in the process. This refresh is triggering a registry refresh. And this registry refresh is running with the fromCache flag as false. This is where the invalid exceptions are coming from. I'm trying a different refresh method. It is building now. |
Can you retest with the latest snapshot? My local recreation of the issue works correctly now. |
eclipse info: greclipse info: JDK version: jdk1.8.0_131 OS info: windows 7 x64 error log: open a java file error:
|
@muyun12 Can you restart eclipse with the |
I have updated Eclipse this morning and its looking pretty good so far. No "Invalid registry object" Errors in my log on startup. |
The "Invalid registry object" errors are also fixed on my machine. Thanks you very much! 👍 |
I'm going to close this issue. I do have a test environment that can recreate it in case you do use the switcher to select an older compiler version. However, based on my attempts to fix this, I think the bug is going to need to be fixed in the Eclipse Platform. |
Hello, I tried the "eclipse -clean" command, without success. But the issue was solved by removing the "package explorer" view, and adding it back to the java perspective. Hope this helps... |
@etienne-sf that works for me but I have to do this every single time I start Eclipse. Is there another way to fix this permanently? I upgraded to eclipse-2018-12 hoping to fix this problem, but it endures. I seriously think I could set my watch based on how long it takes for a working version of Eclipse to suddenly start falling apart (usually around 6 months). |
Right, the same actually. In my case, it's only linked to the groovy plugin. This issue disappeared totally when I re-installed eclipe 2018-12, without the 2.5 groovy compiler. Etienne |
Ugh I hate Eclipse but I am bound to it. Like why are line numbers NOT on by default? In any case, I can't rock Eclipse without my Groovy plugin so I'm screwed. Too bad Eclipse doesn't ship with Groovy by default. |
It is not that Groovy is a patch that causes this particular issue. The compiler switching unloads OSGi bundles and that is why the registry gets messed up. If you only use the Groovy 2.4 compiler, then don't install the Groovy 2.5+ compiler(s) and this issue will not happen. |
@eric-milles How do I do that? When I install Groovy from the update site, it only offers me to install Groovy 2.5. Groovy 2.4 is never even mentioned. When I look into the IDE installation details, I see "Eclipse Groovy Development Tools" with a child (!) "Groovy Compiler 2.4" and a sibling further down "Groovy Compiler 2.5". Is it safe to just uninstall the latter in the dialog? |
@digulla The update site sets Groovy Development Tools as required and Groovy Compiler 2.5 as optional. You should be able to uncheck 2.5 at the time of install. And you should be able to remove the feature after the fact. The Groovy Compiler 2.4 feature is automatically included with Groovy Development Tools as at least one compiler/runtime is required and by bundling the lowest supported version, this invalid registry issue can be avoided. |
Steps to fix this:
The errors should be gone now. Interesting side effect: The "Package Explorer" will have forgotten about the "Top Level Elements" if you had switched them to "Working Sets". |
This is a very weird bug. I would prefer that the code to switch from 2.5 to 2.4 in the workspace preferences warns me that I'll see this error message unless I deinstall 2.5. Especially since you add an error to every project which uses 2.4 when the workspace default is 2.5. So there is a strong urge to switch the default to 2.4 as well but as long as 2.5 is still installed, you'll get this confusing error message above. Since the Sonar plugins showed up in many stack traces, I even got on the wrong track thinking that Sonar was the culprit. |
The switching is not 100% failure rate. I use it with no issue. However, I do not leave auto-build enabled, I close all my editors, etc. It is very hard to pin down the exact circumstances that will trigger this. You can read the history of this and linked issues; this issue manifests itself in many different forms. And at one point in time it worked 100%. So there was some change in platform that started this whole mess off. The invalid registry problems should be opened as a bug in Eclipse Platform and up-voted by all participants in this discussion. |
Opened a bug in Eclipse so we get more information: https://bugs.eclipse.org/bugs/show_bug.cgi?id=548510 |
I can describe what is happening and why an invalid registry object error is produced. The trouble is, it used to work (pre-Neon) and the root problems has to do with loading and unloading of OSGi bundles. I think the e4 UI migrations have led to some components starting earlier than they used to. Due to this (or whatever has changed in the platform) the Groovy compiler chooser component may need to run earlier or be redesigned. |
I think a better error message would still help :-) |
Re: digulla's steps posted on 1st March, 2019: For Eclipse Groovy Development Tools version 3.5.0.v201909291620-e1909-RELEASE running in Eclipse JEE 2019-09, I had to remove all the groovy compilers (2.5 and 3.0 early access) to work around this. @digulla: Many thanks for providing those steps. |
After installing the Groovy-Eclipse in Eclipse 4.7 - Oxygen i get this error after restarting. (See also screenshot at the bottom)
The text was updated successfully, but these errors were encountered: