Код: Выделить всё
[ERROR] /E:/mycode/javaproject/rms/rms-parse/src/main/java/com/example/config/AsyncConfig.java:[19,49] 鎵句笉鍒扮鍙
[ERROR] 绗﹀彿: 鏂规硶 newVirtualThreadPerTaskExecutor()
[ERROR] 浣嶇疆: 绫?java.util.concurrent.Executorss
[ERROR] /E:/mycode/javaproject/rms/rms-parse/src/main/java/com/example/config/AsyncConfig.java:[25,50] 鎵句笉鍒扮鍙
[ERROR] 绗﹀彿: 鏂规硶 newVirtualThreadPerTaskExecutor()
[ERROR] 浣嶇疆: 绫?java.util.concurrent.Executorss
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :rms-parse
Версия Maven: 3.9.5
JDK: 21
Структура проекта:
Код: Выделить всё
rms
- rms-common
- rms-parse
- rms-admin
-
- pom.xml
Код: Выделить всё
org.springframework.boot
spring-boot-starter-parent
3.1.1
com.example
rms
1.0
pom
rms-parse
rms-mapper
rms-service
rms-common
rms-admin
rms-model
UTF-8
21
21
com.github.shalousun
smart-doc-maven-plugin
2.7.7
${basedir}/src/main/resources/smart-doc.json
rms
compile
html
org.apache.maven.plugins
maven-compiler-plugin
3.11.0
21
21
Код: Выделить всё
@Configuration
@Slf4j
public class AsyncConfig {
@Bean
public AsyncTaskExecutor asyncTaskExecutor() {
return new TaskExecutorAdapter(Executors.newVirtualThreadPerTaskExecutor());
}
@Bean
public TomcatProtocolHandlerCustomizer protocolHandlerVirtualThreadExecutorCustomizer() {
return protocolHandler -> {
protocolHandler.setExecutor(Executors.newVirtualThreadPerTaskExecutor());
};
}
}
Код: Выделить всё
jdk-21
true
21
21
21
21
Подробнее здесь: https://stackoverflow.com/questions/772 ... n-an-error
Мобильная версия