redhat-developer / redhat-developer/vscode-java
Run mvn springboot:run fails – conflict with LSP
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 546
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 11
Mô tả
I have a maven java project and sometimes (not always) when I perform a maven build on my project ( the maven build also generates some files..) , the build fails because a conflict with the maven build that the lsp performes. ( The lsp maven build first clean some files and then regenerate them again).
It happens because the initialization of the Java LSP (which triggers a maven call) and the maven call to start the application conflict with each other.
It's basically two build processes running on the same file set at the same time (and it appears both with the clean option). This can lead to unexpected results in case one build process deletes files the other build process just created and requires in a next step.
In the logs here for example , you can see the same issue ( a file "schema.sql" that is missing):
An exception occurred while running. null: InvocationTargetException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat: Error creating bean with name 'cdsODataV4Servlet' defined in class path resource [com/sap/cds/framework/spring/config/CdsODataV4ServletConfig.class]: Unsatisfied dependency expressed through method 'cdsODataV4Servlet' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cdsRuntime' defined in class path resource [com/sap/cds/framework/spring/config/CdsRuntimeConfig.class]: Unsatisfied dependency expressed through method 'cdsRuntime' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'transactionManagerFactory' defined in class path resource [com/sap/cds/framework/spring/config/TransactionConfig.class]: Unsatisfied dependency expressed through method 'transactionManagerFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$DataSourceTransactionManagerConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker': Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.UncategorizedScriptException: Failed to execute database script from resource [URL [file:/home/user/projects/products-service/srv/target/classes/schema.sql]]; nested exception is java.lang.IllegalArgumentException: 'script' must not be null or empty -> [Help 1]
- Can you tell me when the LSP triggers the maven build ? is it on specific actions ? or for example every x seconds ?
- Do you know how can I solve this issue ? ( maybe by configuring something ?)
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện xung đột giữa mvn springboot:run và quá trình khởi tạo Java LSP, đồng thời theo dõi các tệp được tạo, đặc biệt là target/classes/schema.sql. Đọc các build log của Maven và LSP để xác định thời điểm cả hai cùng dọn dẹp và tạo lại các tệp giống nhau; để được xem là hoàn tất, cần xác nhận một trigger và ghi lại hoặc triển khai một cách để ngăn các build chạy đồng thời.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- build-system, devtools
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100