Java Model Exception: Java Model Status [src/main/java/suddenly.in.dot.notation [in some-maven-submodule] is not on its project's build path]
See original GitHub issueI have a maven project, with 5 submodules, nothing too special, Spring Boot 2, Lombok, AWS SDK. Project builds fine, ie, I can mvn test/compile/package/install to hearts’ delight.
When I open this project in VS Code, I get the following errors (many of them, see also attached log):
!ENTRY org.eclipse.jdt.ls.core 4 0 2018-07-11 18:14:02.128
!MESSAGE Failed to publish diagnostics.
!STACK 1
Java Model Exception: Java Model Status [src/main/java/this.in.dot.notation.why [in aesop-dfp] is not on its project's build path]
at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:580)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:253)
at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:527)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:247)
at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:527)
at org.eclipse.jdt.internal.core.CompilationUnit.openAncestors(CompilationUnit.java:1240)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:247)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:593)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:323)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:309)
at org.eclipse.jdt.internal.core.Openable.getBuffer(Openable.java:295)
at org.eclipse.jdt.ls.core.internal.handlers.BuildWorkspaceHandler.publishDiagnostics(BuildWorkspaceHandler.java:112)
at org.eclipse.jdt.ls.core.internal.handlers.BuildWorkspaceHandler.buildWorkspace(BuildWorkspaceHandler.java:65)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$21(JDTLanguageServer.java:672)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$22(JDTLanguageServer.java:716)
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)
!SUBENTRY 1 org.eclipse.jdt.core 4 1006 2018-07-11 18:14:02.132
!MESSAGE src/main/java/this.in.dot.notation.why [in aesop-dfp] is not on its project's build path
Note: I changed the package name.
Environment
- Operating System: Windows 10 x64
- JDK version: OpenJDK 8 r163 x64
- Visual Studio Code version: 1.25.0
- Java extension version: 0.28.0
Steps To Reproduce
- Open Maven project in VS code
- Open log file (see attached)
Current Result
Code completion doesn’t work.
Expected Result
Code completion works.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
519538 – [9] module not on project's build path exception on ...
We get the following exception in Error Log view: Java Model Exception: Java Model Status [<module:java.sql> is not on its project's build path]...
Read more >Java Model Status [gen [in MyApp] does not exist] after Eclipse ...
My error started after renaming the target package in the project. After I tried the solution from ... The Error was due to...
Read more >A lot of errors "Java Model Exception - Katalon Community
[2020-08-25T21:30:48.264] Java Model Exception: Java Model Status [1 [in ReflexShare [in ReflexShare.groovy [in test.common [in Keywords [in ...
Read more >Java model exceptions in the log - IBM
Java ™ model exceptions are sometimes logged to report a Java model status about missing files, even though the files that are reported ......
Read more >The compilation unit is not on the build path.. - CodeRanch
Namely, when I try to type the dot operator in a class I'm writing (under ... "The compilation unit is not on the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s really odd. Can you try the “Clean the Java Language server workspace” command? If it doesn’t fix the issue, we’ll definitely need a sample project to reproduce this issue
@fbricon thanks, that solved my problem