Pretty often when I am refactoring my code and there (one or two files contain pretty broken code) - extension hangs and all it's features stop working.
Restarting VSCode fixes the issue.
My project is super simple (5 classes), has rudimentary pom.xml.
Output window for Language Support for Java shows this error:
[Error - 9:07:53 PM] Aug 1, 2018 9:07:02 PM
null
org.eclipse.jface.text.BadLocationException
at org.eclipse.jface.text.TreeLineTracker.fail(TreeLineTracker.java:1051)
at org.eclipse.jface.text.TreeLineTracker.lineByOffset(TreeLineTracker.java:265)
at org.eclipse.jface.text.TreeLineTracker.getLineNumberOfOffset(TreeLineTracker.java:1119)
at org.eclipse.jface.text.AbstractLineTracker.getLineNumberOfOffset(AbstractLineTracker.java:151)
at org.eclipse.jface.text.AbstractDocument.getLineOfOffset(AbstractDocument.java:868)
at org.eclipse.core.internal.filebuffers.SynchronizableDocument.getLineOfOffset(SynchronizableDocument.java:331)
at org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:60)
at org.eclipse.jdt.ls.core.internal.JDTUtils.toRange(JDTUtils.java:466)
at org.eclipse.jdt.ls.core.internal.JDTUtils.toLocation(JDTUtils.java:380)
at org.eclipse.jdt.ls.core.internal.JDTUtils.toLocation(JDTUtils.java:342)
at org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.collectChildren(DocumentSymbolHandler.java:75)
at org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.collectChildren(DocumentSymbolHandler.java:68)
at org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.getOutline(DocumentSymbolHandler.java:52)
at org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.documentSymbol(DocumentSymbolHandler.java:44)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$12(JDTLanguageServer.java:532)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$23(JDTLanguageServer.java:732)
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Same error and stack dump can be found in the log that I open with "Java: Open Java Language Server log file".
(related?) Dev Tools console log contains quite a lot copies of this warning:
WARN Error: listener failed
at workbench.main.js:sourcemap:4061
at Object.g [as _notify] (workbench.main.js:sourcemap:150)
at Object.enter (workbench.main.js:sourcemap:154)
at n.Class.derive._oncancel._run (workbench.main.js:sourcemap:155)
at n.Class.derive._oncancel._completed (workbench.main.js:sourcemap:155)
at e.resolveOk (workbench.main.js:sourcemap:3060)
at e._receiveReply (workbench.main.js:sourcemap:3127)
at e._receiveOneMessage (workbench.main.js:sourcemap:3126)
at workbench.main.js:sourcemap:3125
at workbench.main.js:sourcemap:3128
at e.fire (workbench.main.js:sourcemap:171)
at c (workbench.main.js:sourcemap:302)
at Socket.<anonymous> (workbench.main.js:sourcemap:303)
at emitOne (events.js:96)
at Socket.emit (events.js:191)
at readableAddChunk (_stream_readable.js:178)
at Socket.Readable.push (_stream_readable.js:136)
at Pipe.onread (net.js:560)
I was experiencing the same issue with the previous version of the extension.
When extension hangs, VSCode status bar usually says "Validating document - 0%"
Not quite sure about the pattern or repro yet, but happens like every hour (=pretty often).
I am having a very similar issue. I was supecting that the problem could be because I am using Lombok in my project and therefore having the lombok.jar file in the classpath could be causing issues. But you don't seem to have Lombok in your project do you @lashchev?
Got same issue here, best way to reproduce is to modify few files quickly and save.
Having the same issue. any idea how to workaround first?
Unfortunately, the only workaround right now is to uninstall the Java Test extension. Make sure to keep the dependencies installed so other Java extensions work properly.
@jdneo Please help take a look at this issue.
Hi @julianosam,
Do you mean the problem will go away if uninstall the Java Test extension?
@jdneo Yes, at least it works for me and I heard it worked for other people too.
I find a surefire way to reproduce this is to annotate a class with ToString using Lombok. I have yet to experience this working without getting stuck at validate documents 0%.
@julianosam No, I don't have Lombok or any other "magic" extension installed. I have a clean portable install of VSCode with Java Extention Pack.
As @paranojk mentioned above quick edits typically lead to this issue and since I have Auto-save enabled - on each save validation is triggered and that validation fails pretty often.
For me, it typically happens when I copy properties or methods with Shift+Alt+Down, but can happen in other cases as well.
After this, something else breaks too and after I reopen workspace I must do "Java update project configuration" with pom.xml open (important) otherwise I will see all kind of other issues.
Disabling Auto-save may probably lower the frequency of the issue, but I don't want to disable it. Removing Test Extension is not an option for me, because I am all TDD
It seems we'll have it fixed next release: https://github.com/redhat-developer/vscode-java/pull/637#pullrequestreview-154492763
Removing auto save solved the issue.
@gitorko May I ask what's the version of the extension are you using?
this is issue is not fixed yet, any updates?
[Error - 涓嬪崍7:44:51] 2019-4-28 19:44:51 Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
null
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.codegen.CodeStream.newArray(CodeStream.java:6096)
at org.eclipse.jdt.internal.compiler.codegen.TypeAnnotationCodeStream.newArray(TypeAnnotationCodeStream.java:88)
at org.eclipse.jdt.internal.compiler.ast.ArrayInitializer.generateCode(ArrayInitializer.java:82)
at org.eclipse.jdt.internal.compiler.ast.ArrayInitializer.generateCode(ArrayInitializer.java:70)
at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.generateCode(ReturnStatement.java:224)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:344)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:281)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:578)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:648)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:410)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:903)
at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:145)
at java.lang.Thread.run(Thread.java:748)
my issue has been resolved. ref
Pretty often when I am refactoring my code and there (one or two files contain pretty broken code) - extension hangs and all it's features stop working.
Restarting VSCode fixes the issue.
My project is super simple (5 classes), has rudimentary pom.xml.
Output window for Language Support for Java shows this error:
[Error - 9:07:53 PM] Aug 1, 2018 9:07:02 PM null org.eclipse.jface.text.BadLocationException at org.eclipse.jface.text.TreeLineTracker.fail(TreeLineTracker.java:1051) at org.eclipse.jface.text.TreeLineTracker.lineByOffset(TreeLineTracker.java:265) at org.eclipse.jface.text.TreeLineTracker.getLineNumberOfOffset(TreeLineTracker.java:1119) at org.eclipse.jface.text.AbstractLineTracker.getLineNumberOfOffset(AbstractLineTracker.java:151) at org.eclipse.jface.text.AbstractDocument.getLineOfOffset(AbstractDocument.java:868) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.getLineOfOffset(SynchronizableDocument.java:331) at org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:60) at org.eclipse.jdt.ls.core.internal.JDTUtils.toRange(JDTUtils.java:466) at org.eclipse.jdt.ls.core.internal.JDTUtils.toLocation(JDTUtils.java:380) at org.eclipse.jdt.ls.core.internal.JDTUtils.toLocation(JDTUtils.java:342) at org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.collectChildren(DocumentSymbolHandler.java:75) at org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.collectChildren(DocumentSymbolHandler.java:68) at org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.getOutline(DocumentSymbolHandler.java:52) at org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.documentSymbol(DocumentSymbolHandler.java:44) at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$12(JDTLanguageServer.java:532) at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$23(JDTLanguageServer.java:732) at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)Same error and stack dump can be found in the log that I open with "Java: Open Java Language Server log file".
(related?) Dev Tools console log contains quite a lot copies of this warning:
WARN Error: listener failed at workbench.main.js:sourcemap:4061 at Object.g [as _notify] (workbench.main.js:sourcemap:150) at Object.enter (workbench.main.js:sourcemap:154) at n.Class.derive._oncancel._run (workbench.main.js:sourcemap:155) at n.Class.derive._oncancel._completed (workbench.main.js:sourcemap:155) at e.resolveOk (workbench.main.js:sourcemap:3060) at e._receiveReply (workbench.main.js:sourcemap:3127) at e._receiveOneMessage (workbench.main.js:sourcemap:3126) at workbench.main.js:sourcemap:3125 at workbench.main.js:sourcemap:3128 at e.fire (workbench.main.js:sourcemap:171) at c (workbench.main.js:sourcemap:302) at Socket.<anonymous> (workbench.main.js:sourcemap:303) at emitOne (events.js:96) at Socket.emit (events.js:191) at readableAddChunk (_stream_readable.js:178) at Socket.Readable.push (_stream_readable.js:136) at Pipe.onread (net.js:560)I was experiencing the same issue with the previous version of the extension.
When extension hangs, VSCode status bar usually says "Validating document - 0%"
Environment
- Operating System: Win10 v1803
- JDK version: 1.8.0_181
- Visual Studio Code version: 1.25.1
- Java extension version: 0.29.0
Steps To Reproduce
Not quite sure about the pattern or repro yet, but happens like every hour (=pretty often).
This seems to be still an issue, however, fortunately, it doesn't completely hang for me and can continue to use it. Any ideas how to resolve it?
Most helpful comment
I find a surefire way to reproduce this is to annotate a class with ToString using Lombok. I have yet to experience this working without getting stuck at validate documents 0%.