Eclipse Oxygen fails to run - org.eclipse.swt.SWTException: Invalid thread access - java-9

I have following problem: my eclipse Oxygen fails to run(error attached).
Everything is fine on fresh instalation, when I run it just after downloading (tested on 1a september and 2 december). However, when i restart my computer, eclipse won't start again unless i will reinstall it.
I have cleared both eclipse cache as same as my project (even fetched fresh version from repo), workspace and eclipse instalation place is also fresh.
I have read e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=475392, https://bugs.eclipse.org/bugs/show_bug.cgi?id=514895 and other related posts, didn't help though.
Any idea? I am working on windows 10 64 bit, and JDK 9.0.1+11. My only plugin is BndTools 3.5, latest, project requires java 8 (current runtime jdk is 152).
Problem started on friday, 15 dec after running my project and resolving dependencies at example bnd project (http://enroute.osgi.org/tutorial_base/600-testing.html) at the same time. Couldn't run eclipse after that.
However, i did it before and didn't meet any problems (i mean opening example and running it). Also, I have cleared p2, mvn and bnd cache.
Below mentioned stack from eclipse .log:
!SESSION 2017-12-18 16:47:57.660 -----------------------------------------------
eclipse.buildId=4.7.2.M20171123-0800
java.version=9.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pl_PL
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
!ENTRY org.eclipse.osgi 4 0 2017-12-18 16:47:59.711
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4533)
at org.eclipse.swt.SWT.error(SWT.java:4448)
at org.eclipse.swt.SWT.error(SWT.java:4419)
at org.eclipse.swt.widgets.Display.error(Display.java:1263)
at org.eclipse.swt.widgets.Display.checkDevice(Display.java:767)
at org.eclipse.swt.widgets.Display.addListener(Display.java:628)
at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.<init>(IDEWorkbenchAdvisor.java:187)
at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.<init>(IDEWorkbenchAdvisor.java:195)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
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 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:564)
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:1499)
Diff between fresh and dirty instalation
Update
After flushing whole system, problem gone for a while, however came back again, so it eliminates OS influence in my opinion.
As Struarf mentioned in his answer, deletion of configuration/org.eclipse.osgi templorary solves problem.
Nevertheless, when i have installed oxygen 2, I noticed that this problem is much more rarer than before (actually now 2nd time for 2 weeks, whether before was with each possible occasion), so maybe it comes in a good way...

I've just commented on bug 477247. I'm getting a similar exception (on OSX). What allows me to start Eclipse without reinstalling is to delete the configuration/org.eclipse.osgi folder. It looked like a bundle cache, and deleting such caches has worked elsewhere for me. Hopefully this might also provide a clue for the devs.

You seem to hit bug 477247. Until now, Eclipse developers were not able to reproduce the issue, maybe you can help them by adding steps to reproduce to the bug, or any other useful details.

Related

IntelliJ IDEA suddenly won't open on Mac "Error occurred during initialization of VM"

IntelliJ IDEA suddenly wouldn't open on my Mac (Intel). The app icon bounces but then nothing happens—no crash report or any kind of message—and there's nothing in Activity Monitor or ps.
Then I tried running it from terminal and got this:
$ /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
2023-02-08 07:47:52.953 idea[10131:63714] allVms required 1.8*,1.8+
2023-02-08 07:47:52.955 idea[10131:63717] Current Directory: /Applications/IntelliJ IDEA.app/Contents/MacOS
2023-02-08 07:47:52.955 idea[10131:63717] Value of IDEA_VM_OPTIONS is (null)
2023-02-08 07:47:52.955 idea[10131:63717] fullFileName is: /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions
2023-02-08 07:47:52.955 idea[10131:63717] fullFileName exists: /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions
2023-02-08 07:47:52.956 idea[10131:63717] Processing VMOptions file at /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions
2023-02-08 07:47:52.956 idea[10131:63717] Done
Error occurred during initialization of VM
java.lang.NoClassDefFoundError: com/intellij/util/lang/UrlClassLoader
at java.lang.ClassLoader.defineClass1(java.base#11.0.13/Native Method)
at java.lang.ClassLoader.defineClass(java.base#11.0.13/ClassLoader.java:1017)
at java.security.SecureClassLoader.defineClass(java.base#11.0.13/SecureClassLoader.java:174)
at jdk.internal.loader.BuiltinClassLoader.defineClass(java.base#11.0.13/BuiltinClassLoader.java:800)
at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(java.base#11.0.13/BuiltinClassLoader.java:698)
at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(java.base#11.0.13/BuiltinClassLoader.java:621)
at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base#11.0.13/BuiltinClassLoader.java:579)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base#11.0.13/ClassLoaders.java:178)
at java.lang.ClassLoader.loadClass(java.base#11.0.13/ClassLoader.java:522)
at java.lang.Class.forName0(java.base#11.0.13/Native Method)
at java.lang.Class.forName(java.base#11.0.13/Class.java:398)
at java.lang.ClassLoader.initSystemClassLoader(java.base#11.0.13/ClassLoader.java:1976)
at java.lang.System.initPhase3(java.base#11.0.13/System.java:2074)
Caused by: java.lang.ClassNotFoundException: com.intellij.util.lang.UrlClassLoader
at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base#11.0.13/BuiltinClassLoader.java:581)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base#11.0.13/ClassLoaders.java:178)
at java.lang.ClassLoader.loadClass(java.base#11.0.13/ClassLoader.java:522)
at java.lang.ClassLoader.defineClass1(java.base#11.0.13/Native Method)
at java.lang.ClassLoader.defineClass(java.base#11.0.13/ClassLoader.java:1017)
at java.security.SecureClassLoader.defineClass(java.base#11.0.13/SecureClassLoader.java:174)
at jdk.internal.loader.BuiltinClassLoader.defineClass(java.base#11.0.13/BuiltinClassLoader.java:800)
at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(java.base#11.0.13/BuiltinClassLoader.java:698)
at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(java.base#11.0.13/BuiltinClassLoader.java:621)
at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base#11.0.13/BuiltinClassLoader.java:579)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base#11.0.13/ClassLoaders.java:178)
at java.lang.ClassLoader.loadClass(java.base#11.0.13/ClassLoader.java:522)
at java.lang.Class.forName0(java.base#11.0.13/Native Method)
at java.lang.Class.forName(java.base#11.0.13/Class.java:398)
at java.lang.ClassLoader.initSystemClassLoader(java.base#11.0.13/ClassLoader.java:1976)
at java.lang.System.initPhase3(java.base#11.0.13/System.java:2074)
I tried various things I read online:
I tried removing idea.vmoptions in /Applications/IntelliJ\ IDEA.app/Contents/MacOS/ as well as ~/Library/Application\ Support/JetBrains/<product>/.
I restored them but checked that -Xmx was not smaller than -Xms.
I tried deleting plugins.
I tried restoring the JDK and messing with PATH and environment.
Possible causes were updating from macOS Ventura 13.1 to 13.2 yesterday. Or, installing the bined plugin yesterday.
Self-answering to help people. Try simply upgrading to the latest IntelliJ IDEA.
For some reason it was the last thing I tried, i.e. downloading the latest .dmg and installing (dragging into Applications and replacing previous version). I was on Ultimate so I downloaded Ultimate, but if you're on CE (Community Edition) you should download that. I guess in the past upgrading IntelliJ caused things to break for me, so I avoided it until I tried everything else. But this time it was the solution. Also for some reason none of the threads I read online mentioned this as the solution—maybe too obvious but hey, I would have tried it sooner if I read it.

Spring properties editor error upon upgrading to Eclipse 2022 ("Failed to create the part's controls", NCDF error "javax/inject/Provider")

My version of Eclipse was updated to 2022-03 this morning, and now I cannot open the application.properties file in my Spring projects. (At least, not in the Spring editor; it's still fine in a plain text editor, of course.)
The error message is "Failed to create the part's controls"
Stack trace begins
"java.lang.NoClassDefFoundError: java/inject/Provider"
Nested error
"java.lang.ClassNotFoundException: javax.inject.Provider cannot be found by org.springframework.ide.eclipse.boot.properties.editor_3.9.15.202012132325-RELEASE"
Session data from the error:
eclipse.buildId=4.23.0.I20220308-0310
java.version=15.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product -keyring /Users/xxxx/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/xxxx/.eclipse_keyring
I've tried running from the CL with the "-clean" flag. I've also tried renaming directories having to do with editing in my .plugins folder, to have them regenerated anew. No luck. I did check for later updates in case a known bug went out in the distribution last night.
If it matters, I have a Java8 JRE on my machine, a Mac. Anyone else having this problem, and any ideas on what to try next? Thanks.
i installed Spring Tools 4 (4.14.0 RELEASE) and i don't have this error anymore , like howgler said it's a problem of outdated spring editor version .
Update notes : https://spring.io/blog/2022/03/16/spring-tools-4-14-0-released

SonarQube 5.1 PAM - no jpam in java.library.path

I'm unable to use PAM plugin on SonarQube 5.1 on Debian 8 (64bit).
I did setup according to https://github.com/SonarCommunity/sonar-pam and still getting following error during login:
Java::JavaLang::UnsatisfiedLinkError (no jpam in java.library.path):
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
java.lang.Runtime.loadLibrary0(Runtime.java:849)
java.lang.System.loadLibrary(System.java:1088)
net.sf.jpam.Pam.<clinit>(Pam.java:51)
org.sonar.plugins.pam.PamConfiguration.newInstance(PamConfiguration.java:61)
org.sonar.plugins.pam.PamConfiguration.getPAM(PamConfiguration.java:49)
org.sonar.plugins.pam.PamAuthenticator.authenticate(PamAuthenticator.java:45)
org.sonar.api.security.SecurityRealm$1.doAuthenticate(SecurityRealm.java:60)
Here's setup (sonar is located at /var/lib/sonarqube-5.1):
/var/lib/sonarqube-5.1/lib/JPam-1.1.jar
native libs (64bit and 32bit) have been put to /var/lib/sonarqube-5.1/bin/linux-x86-64/lib/libjpam.so and /var/lib/sonarqube-5.1/bin/linux-x86-32/lib/libjpam.so (just for sure in case sonar was run as 32bit)
All directories leading to native libraries and libraries themselves have +rx access
Any idea what can be causing problem?
I'd print the java.library.path variable. The only thing I can think of is that the jpam lib is in the wrong place or there is an issue with permissions. (Did you check the SonarQube user can actually read that file?)
UPDATE
Check java.library.path in Settings->System Info page
Move jpam lib to one of those paths

Netbeans NullpointerException at startup

When I start Netbeans 6.0.1 up, I get the following error message:
java.lang.NullPointerException
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:521)
at com.sun.servicetag.RegistrationDocument.initializeDocument(RegistrationDocument.java:121)
at com.sun.servicetag.RegistrationDocument.load(RegistrationDocument.java:81)
at com.sun.servicetag.RegistrationData.loadFromXML(RegistrationData.java:392)
at org.netbeans.modules.reglib.NbServiceTagSupport.getRegistrationData(NbServiceTagSupport.java:373)
at org.netbeans.modules.reglib.NbServiceTagSupport.getNbServiceTag(NbServiceTagSupport.java:453)
at org.netbeans.modules.reglib.NbServiceTagSupport.createNbServiceTag(NbServiceTagSupport.java:171)
at org.netbeans.modules.registration.NbInstaller.restored(NbInstaller.java:98)
at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:378)
at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:297)
at org.netbeans.ModuleManager.enable(ModuleManager.java:933)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:405)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:341)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:275)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:171)
at org.netbeans.core.startup.Main.start(Main.java:322)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:110)
[catch] at java.lang.Thread.run(Thread.java:655)
It doesn't keep Netbeans from functioning, I think, but what does it mean and how should I fix it?
Firstly, I would try a newer version of netbeans. 6.0.1 is well over 5 years old.
Also, try clearing out the netbeans cache. On linux, it's stored at $HOME/.netbeans/
Not sure where it would be stored on OSX.
As for what it means - read over this question/answer: What is a Null Pointer Exception?

Eclipse plug-ins disappeared after update

Have been updated Eclipse PDT using Window->Check for Updates feature.
After restart all trird-party plug-ins seems like switched off.
Starting with -clean command line key doesn't helps.
Eclipse Installation Detals contains information about all my plug-ins correctly.
Error log:
eclipse.buildId=M20090917-0800
java.version=1.6.0_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=ru_RU
Framework arguments: -product org.eclipse.epp.package.php.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.php.product
!ENTRY org.eclipse.team.core 4 0 2009-11-24 12:52:00.804
!MESSAGE Could not instantiate provider org.eclipse.team.svn.core.svnnature for project Search.
!STACK 1
org.eclipse.team.core.TeamException: Could not instantiate provider org.eclipse.team.svn.core.svnnature for project Search.
at org.eclipse.team.core.RepositoryProvider.mapNewProvider(RepositoryProvider.java:165)
at org.eclipse.team.core.RepositoryProvider.mapExistingProvider(RepositoryProvider.java:235)
at org.eclipse.team.core.RepositoryProvider.getProvider(RepositoryProvider.java:507)
at org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator.isMappedToCVS(CVSLightweightDecorator.java:192)
at org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator.decorate(CVSLightweightDecorator.java:147)
at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:263)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:81)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:365)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:347)
at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371)
at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 org.eclipse.team.core 4 0 2009-11-24 12:52:00.804
!MESSAGE Could not instantiate provider org.eclipse.team.svn.core.svnnature for project Search.
Mar Cel was right:
Here i have write it in my german language wiki.
You need to chown the eclipse-programm-folder to full access permissions for the workspace-owner.
Start eclipse. Stop it, Rechange the owner back to root, and restart eclipse again.. After that, all works well for me (Eclipse 3.7.2)
Wiki
http://wiki.xstable.de/doku.php/entwicklungsumgebung:eclipse:faq?&#keine_plugins_mehr_in_eclipse_nach_update
Solution is use Equinox p2 Installer!
There is no other offline ways to install/reinstall plugins or features.
This seems to be an issue with writing permission of the Eclipse executing user. My guess is that the user can write metadata to workspace, therefore Eclipse shows you that the plugins were installed successfully but are obviously not available in the GUI, as none of the features were really installed in Eclipse itself.
Just alter the Eclipse program folders to give full permissions to the user actually executing Eclipse. Eclipse will then recognize that the metadata is wrong, repair them, and let you install the plugins once again. After that, all features will be available.

Resources