Skip to content
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

NPE When there's a validation error #927

Closed
fbricon opened this issue Nov 10, 2020 · 0 comments · Fixed by #929 or enxio/lsp4xml#94
Closed

NPE When there's a validation error #927

fbricon opened this issue Nov 10, 2020 · 0 comments · Fixed by #929 or enxio/lsp4xml#94
Assignees
Labels
bug Something isn't working validation
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Nov 10, 2020

I can't reproduce it, But at some point, given this:

<?xml version="1.0" encoding="UTF-8"?>
<xmlip xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="xml.xsd">
    <hh>
        
    </hh>
<hh>

</hh>
<ds>
    
</ds>
</xmlip>

and its xml.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="xmlip">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="hh" type="xs:string" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

I got that NPE, while diagnostics: were being computed

[Error - 11:41:58 PM] Nov 09, 2020 11:41:58 org.eclipse.lemminx.extensions.contentmodel.participants.diagnostics.XMLValidator doDiagnostics()
Message: Unexpected XMLValidator error
java.lang.NullPointerException
	at org.eclipse.lemminx.extensions.contentmodel.participants.diagnostics.LSPErrorReporterForXML.toLSPRange(LSPErrorReporterForXML.java:76)
	at org.eclipse.lemminx.extensions.xerces.AbstractLSPErrorReporter.internalToLSPRange(AbstractLSPErrorReporter.java:161)
	at org.eclipse.lemminx.extensions.xerces.AbstractLSPErrorReporter.reportError(AbstractLSPErrorReporter.java:95)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.eclipse.lemminx.extensions.contentmodel.participants.diagnostics.XMLValidator.parseXML(XMLValidator.java:129)
	at org.eclipse.lemminx.extensions.contentmodel.participants.diagnostics.XMLValidator.doDiagnostics(XMLValidator.java:100)
	at org.eclipse.lemminx.extensions.contentmodel.participants.diagnostics.ContentModelDiagnosticsParticipant.doDiagnostics(ContentModelDiagnosticsParticipant.java:50)
	at org.eclipse.lemminx.services.XMLDiagnostics.doExtensionsDiagnostics(XMLDiagnostics.java:58)
	at org.eclipse.lemminx.services.XMLDiagnostics.doDiagnostics(XMLDiagnostics.java:41)
	at org.eclipse.lemminx.services.XMLLanguageService.doDiagnostics(XMLLanguageService.java:161)
	at org.eclipse.lemminx.services.XMLLanguageService.publishDiagnostics(XMLLanguageService.java:170)
	at org.eclipse.lemminx.XMLTextDocumentService.validate(XMLTextDocumentService.java:512)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$triggerValidationFor$26(XMLTextDocumentService.java:505)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

[Error - 11:41:58
@fbricon fbricon added the bug Something isn't working label Nov 10, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this issue Nov 10, 2020
Fixes eclipse#927

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Nov 10, 2020
Fixes eclipse#927

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Nov 10, 2020
Fixes eclipse#927

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Nov 10, 2020
Fixes eclipse#927

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Nov 10, 2020
Fixes eclipse#927

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Nov 10, 2020
Fixes eclipse#927

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Nov 10, 2020
Fixes eclipse#927

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Nov 10, 2020
Fixes eclipse#927

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr self-assigned this Nov 10, 2020
@angelozerr angelozerr added this to the 0.14.1 milestone Nov 10, 2020
fbricon pushed a commit that referenced this issue Nov 10, 2020
Fixes #927

Signed-off-by: azerr <azerr@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validation
Projects
None yet
2 participants