question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nullpointer Exception in catalog extension

See original GitHub issue

If the client doesn’t send the xml.catalog: [] array setting explicitly upon initialization, the following Nullpointer exception is raised by the Arrays.stream().

lemminx: Aug 01, 2020 3:17:00 PM org.eclipse.lemminx.XMLLanguageServer initialize
lemminx: INFORMATION: Initializing XML Language server
lemminx: LemMinX Server info:
lemminx:  - Version : 0.13.1
lemminx:  - Java : C:\Program Files\Java\jre1.8.0_251
lemminx:  - Git 3c6c0de - [maven-release-plugin] prepare release 0.13.1
lemminx: Aug 01, 2020 3:17:00 PM org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry registerExtension
lemminx: SCHWERWIEGEND: Error while initializing extension <org.eclipse.lemminx.extensions.catalog.XMLCatalogPlugin>
lemminx: java.lang.NullPointerException
lemminx: 	at java.util.Arrays.stream(Unknown Source)
lemminx: 	at org.eclipse.lemminx.extensions.catalog.XMLCatalogPlugin.validateCatalogPaths(XMLCatalogPlugin.java:70)
lemminx: 	at org.eclipse.lemminx.extensions.catalog.XMLCatalogPlugin.doSave(XMLCatalogPlugin.java:47)
lemminx: 	at org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry.registerExtension(XMLExtensionsRegistry.java:201)
lemminx: 	at org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry.lambda$initialize$2(XMLExtensionsRegistry.java:191)
lemminx: 	at java.lang.Iterable.forEach(Unknown Source)
lemminx: 	at org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry.initialize(XMLExtensionsRegistry.java:190)
lemminx: 	at org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry.initializeIfNeeded(XMLExtensionsRegistry.java:180)
lemminx: 	at org.eclipse.lemminx.services.extensions.XMLExtensionsRegistry.getDiagnosticsParticipants(XMLExtensionsRegistry.java:132)
lemminx: 	at org.eclipse.lemminx.services.XMLDiagnostics.doExtensionsDiagnostics(XMLDiagnostics.java:83)
lemminx: 	at org.eclipse.lemminx.services.XMLDiagnostics.doDiagnostics(XMLDiagnostics.java:53)
lemminx: 	at org.eclipse.lemminx.services.XMLLanguageService.doDiagnostics(XMLLanguageService.java:159)
lemminx: 	at org.eclipse.lemminx.services.XMLLanguageService.publishDiagnostics(XMLLanguageService.java:168)
lemminx: 	at org.eclipse.lemminx.XMLTextDocumentService.validate(XMLTextDocumentService.java:466)
lemminx: 	at org.eclipse.lemminx.XMLTextDocumentService.lambda$triggerValidationFor$23(XMLTextDocumentService.java:459)
lemminx: 	at java.util.concurrent.CompletableFuture.uniAccept(Unknown Source)
lemminx: 	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(Unknown Source)
lemminx: 	at java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
lemminx: 	at java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
lemminx: 	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source)
lemminx: 	at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
lemminx: 	at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

The ContentModelSettings object should return safe defaults if no catalog is present (empty array instead of null) or validateCatalogPaths() should handle the null return value properly.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
angelozerrcommented, Aug 7, 2020

I don’t have JDK installed and don’t intend to start developing in Java anytime soon.

Ok thanks for your answer.

@datho7561 could you take care of this issue please.

0reactions
datho7561commented, Aug 10, 2020

@fbricon I double checked. After this PR, no NPE will occur when launching the server with no configuration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null pointer exception occurs when a catalog service domain ...
When a catalog service domain fails during the replication process, null pointer exceptions occur when the catalog service domain comes back ...
Read more >
Solr Deployment fails with NullPointer Exception during the ...
Solr Deployment is failing with NullPointer Exception during the Catalog service startup in Enterprise Data Catalog (EDC):.
Read more >
java - What is a NullPointerException, and how do I fix it?
The NullPointerException (NPE) typically occurs when you declare a variable but did not create an object and assign it to the variable before...
Read more >
How to resolve the java.lang.NullPointerException - Educative.io
In Java, the java.lang.NullPointerException is thrown when a reference variable is accessed (or de-referenced) and is not pointing to any object.
Read more >
Null Pointer Exception using connector extension with a third ...
Null Pointer Exception using connector extension with a third-party(custom) camel component · Issue · Environment · Subscriber exclusive content.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found