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

Java Model Exception: Error in Java Model (code 969): <parent_project_name> does not exist #3344

Closed
oicq1699 opened this issue Oct 17, 2023 · 4 comments

Comments

@oicq1699
Copy link

[provide a description of the issue]
When pom.xml is opened, the following exception message is displayed:
Java Model Exception: Error in Java Model (code 969): <parent_project_name> does not exist

Environment

I'm running on SSH remote environment

  • Operating System: Debian GNU/Linux 11 (bullseye)
  • JDK version: OpenJDK Runtime Environment (build 1.8.0_342-b07)
  • Visual Studio Code version: 版本: 1.83.1 (user setup)
Steps To Reproduce
  1. Create a Maven-based multi-module project, one parent module, three sub-modules

  2. Open the parent module folder with vscode, and click on pom.xml in any module after loading is complete, this error will occur.

I have tried to clear the workspace numerous times and the error still persists

[Please attach a sample project reproducing the error]
The project directory structure is as follows
root@7027c0959c2d:~/java/projects/project_template# tree
.
├── pom.xml
├── project_template_api
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ └── java
│ └── target
│ └── classes
├── project_template_biz
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ └── java
│ └── target
│ └── classes
└── project_template_web
├── pom.xml
├── src
│ ├── main
│ │ ├── java
│ │ └── resources
│ │ └── banner.txt
│ └── test
└── target
└── classes

Parent module(project_template) pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>


 
    <groupId>cn.ttt</groupId>
    <artifactId>project_template</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <name>project_template</name>
    <description>project_template</description>
    
	<packaging>pom</packaging>

    <modules>
        <module>project_template_api</module>
        <module>project_template_biz</module>
        <module>project_template_web</module>
    </modules>
</project>

Sub module pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    


    <groupId>cn.ttt</groupId>
    <artifactId>project_template_api</artifactId>
    <name>project_template_api</name>
    <description> </description>
    <version>1.0.0-SNAPSHOT</version>
	<packaging>jar</packaging>


    <parent>
        <groupId>cn.ttt</groupId>
        <version>1.0.0-SNAPSHOT</version>
        <artifactId>project_template</artifactId>
    </parent>
 

</project>

Please attach logs

Current Result

Output exception message:

Java Model Exception: Error in Java Model (code 969): project_template does not exist
	at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:550)
	at org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:2567)
	at org.eclipse.jdt.internal.core.JavaProject.getPerProjectInfo(JavaProject.java:2445)
	at org.eclipse.jdt.internal.core.JavaProject.getRawClasspath(JavaProject.java:2488)
	at org.eclipse.jdt.ls.core.internal.ProjectUtils.listSourcePaths(ProjectUtils.java:245)
	at org.eclipse.jdt.ls.core.internal.commands.ProjectCommand.getProjectSettings(ProjectCommand.java:113)
	at com.yybp.jdtls.ext.mybatis.MybatisCommandHandler.getJavaProjectInfo(MybatisCommandHandler.java:57)
	at com.yybp.jdtls.ext.mybatis.MybatisCommandHandler.executeCommand(MybatisCommandHandler.java:40)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:613)
	at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

Expected Result

no error

Additional Informations

java-language-server-log-file.txt

@testforstephen
Copy link
Collaborator

at com.yybp.jdtls.ext.mybatis.MybatisCommandHandler.getJavaProjectInfo(MybatisCommandHandler.java:57)
at com.yybp.jdtls.ext.mybatis.MybatisCommandHandler.executeCommand(MybatisCommandHandler.java:40)

The exception is threw from other extension Mybatis. I have no idea about this extension. Do you know what this extension is and open the issue there?

@oicq1699
Copy link
Author

at com.yybp.jdtls.ext.mybatis.MybatisCommandHandler.getJavaProjectInfo(MybatisCommandHandler.java:57)
at com.yybp.jdtls.ext.mybatis.MybatisCommandHandler.executeCommand(MybatisCommandHandler.java:40)

The exception is threw from other extension Mybatis. I have no idea about this extension. Do you know what this extension is and open the issue there?

Thank you very much for your reply. It is indeed this extension that caused this problem. After I disabled it, everything became normal.

@testforstephen
Copy link
Collaborator

What extension is it? Do you mind sharing the extension link here? thanks.

@oicq1699
Copy link
Author

What extension is it? Do you mind sharing the extension link here? thanks.

name: MybatisX
ID: yangbaopan.vscode-java-ibatisx
versions: 2023.9.2101
VS Marketplace link: https://marketplace.visualstudio.com/items?itemName=yangbaopan.vscode-java-ibatisx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants