admin管理员组文章数量:1026989
I'm trying to start up a simple REST server (Spring Boot 3, Spring Web).
I'm used to Maven, but this time I had to use Gradle. Never had business with it before.
I may have messed up the setup. Once I launch the application, I get a flurry of errors.
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springdoc.webmvc.ui.SwaggerConfig] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@1d44bcfa]
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/servlet/resource/LiteWebJarsResourceResolver
Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.resource.LiteWebJarsResourceResolver
Execution failed for task ':com.example.socks_api.SocksApiApplication.main()'.
> Process 'command 'C:\Users\nadch\.jdks\corretto-17.0.13\bin\java.exe'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .
BUILD FAILED in 17s
3 actionable tasks: 3 executed
As I believe everything else is irrelevant, I only share my build.gradle.kts
file (I may share other information if necessary).
plugins {
java
id("org.springframework.boot") version "3.3.7"
id("io.spring.dependency-management") version "1.1.7"
}
group = "com.example"
version = "0.0.1-SNAPSHOT"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0")
implementation("org.mapstruct:mapstruct:1.6.3")
runtimeOnly("org.postgresql:postgresql")
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
annotationProcessor("org.mapstruct:mapstruct-processor:1.6.3")
annotationProcessor("org.projectlombok:lombok-mapstruct-binding:0.2.0")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
tasks.withType<Test> {
useJUnitPlatform()
}
This simialar question suggests it may have to do with springdoc
. However, as you may see, I do include the right dependency and do not include springdoc-openapi-ui
.
How do I resolve this problem?
I'm trying to start up a simple REST server (Spring Boot 3, Spring Web).
I'm used to Maven, but this time I had to use Gradle. Never had business with it before.
I may have messed up the setup. Once I launch the application, I get a flurry of errors.
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springdoc.webmvc.ui.SwaggerConfig] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@1d44bcfa]
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/servlet/resource/LiteWebJarsResourceResolver
Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.resource.LiteWebJarsResourceResolver
Execution failed for task ':com.example.socks_api.SocksApiApplication.main()'.
> Process 'command 'C:\Users\nadch\.jdks\corretto-17.0.13\bin\java.exe'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .
BUILD FAILED in 17s
3 actionable tasks: 3 executed
As I believe everything else is irrelevant, I only share my build.gradle.kts
file (I may share other information if necessary).
plugins {
java
id("org.springframework.boot") version "3.3.7"
id("io.spring.dependency-management") version "1.1.7"
}
group = "com.example"
version = "0.0.1-SNAPSHOT"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0")
implementation("org.mapstruct:mapstruct:1.6.3")
runtimeOnly("org.postgresql:postgresql")
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
annotationProcessor("org.mapstruct:mapstruct-processor:1.6.3")
annotationProcessor("org.projectlombok:lombok-mapstruct-binding:0.2.0")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
tasks.withType<Test> {
useJUnitPlatform()
}
This simialar question suggests it may have to do with springdoc
. However, as you may see, I do include the right dependency and do not include springdoc-openapi-ui
.
How do I resolve this problem?
本文标签: javaClassNotFoundError on app launch Spring Boot 3springdocGradleStack Overflow
版权声明:本文标题:java - ClassNotFoundError: on app launch: Spring Boot 3, springdoc, Gradle - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1735967738a1369852.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论