Comments (6)
From the BI logs, this issue is easier to happen when new version of vscode-java is just released. This might be related to the activation of plugin.
from vscode-java.
Latest call stack:
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.m2e.core.embedder.IMaven.getSettings()" because the return value of "org.eclipse.m2e.core.MavenPlugin.getMaven()" is null
at org.eclipse.jdt.ls.core.internal.preferences.StandardPreferenceManager.update(StandardPreferenceManager.java:125)
at org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.handleInitializationOptions(BaseInitHandler.java:115)
at org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:109)
at org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:64)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:283)
... 17 more
This NPE is also easier to happen for Windows than other platforms (macOS and linux).
from vscode-java.
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.m2e.core.embedder.IMaven.getSettings()" because the return value of "org.eclipse.m2e.core.MavenPlugin.getMaven()" is null
at org.eclipse.jdt.ls.core.internal.preferences.StandardPreferenceManager.update(StandardPreferenceManager.java:125)
Will it be auto resolved (i.e. no NPE) next time when it tries to import the Maven project? If so, is there any approach we can do in jdt.ls.core to catch the NPE and do something to mitigate the issue?
from vscode-java.
Will it be auto resolved (i.e. no NPE) next time when it tries to import the Maven project? If so, is there any approach we can do in jdt.ls.core to catch the NPE and do something to mitigate the issue?
I believe so. This NPE rate goes to a PEAK at the first week of new vscode-java release and then goes down to a lower rate. This is because most of users upgrade to new version on the first week of new release.
from vscode-java.
Add @fbricon @rgrunber, since your team is more familiar with m2e mechanism. org.eclipse.m2e.core.MavenPlugin.getMaven()
returns null when activating jdt.ls.
from vscode-java.
Interesting observation (about the errors peaking during a new release). Maybe it's a case of the newer m2e invalidating some aspect of the older settings, that then gets automatically fixed ?
Happens at : StandardPreferenceManager.update(..)
Update: Seems similar to eclipse-m2e/m2e-core#966 which points to an issue with org.eclipse.core.resources
. It might be related to the initial startup, that caches the Equinox dependency wiring under $HOME/.config/Code/User/globalStorage/redhat.java/${version}/config_linux/
.
The problem is somewhere at https://github.com/eclipse-m2e/m2e-core/blob/2.6.0/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java#L68-L86 -> https://github.com/eclipse-equinox/equinox/blob/R4_32_maintenance/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/ServiceTracker.java#L677-L693 . I don't think the activator or the bundle context are null
though there's a chance maybe the bundle context somehow might be. I think it's more likely the failure is happening somewhere in getting the registered services but not sure how.
from vscode-java.
Related Issues (20)
- Bug: Quick fix does not suggest basic imports as a solution HOT 5
- Format document doesn't work when document is not saved HOT 1
- Properties files does not show context menu options from other extension HOT 2
- Incorrect TextMate semantic meaning of tokens when using Lombok
- 'Type Pattern' being reported as an error even though Java source level is above 16 HOT 14
- after each file save action, "vscode redhat-java language support extension" removes target folder files
- New Java File -> Class/Interface option defaults file name to public class Main {.java HOT 2
- Convert `fs` calls to async HOT 2
- [BUG] When settings.json changed, crash HOT 2
- The method builder() is undefined for the type xxx HOT 7
- command 'nbls.java.generate.getter.setter' not found HOT 1
- "java.lang.IllegalArgumentException: Bad escape" when path has non-ASCII characters HOT 6
- java
- Importing package from non-transitively exposed dependency in Gradle project does not display error HOT 1
- [BUG]Error response to external storage devices
- Outline view should indicate access modifiers HOT 1
- vscode-java cannot handle type parameter
- Invalid runtime for JavaSE-1.8: The path (/usr/lib/jvm/java-8-openjdk) does not point to a JDK.
- Dead code - false positive HOT 2
- Compiler issues HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-java.