I'm trying to implement a spring boot rest documentation using springdoc-openapi. I use spring boot 3.0.0.
I add this dependency to my build.gradle:
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.0.2'
When I start my server and go to : http://localhost:8080/swagger-ui.html or http://localhost:8080/v3/api-docs
I receive a 404 error.
what am I doing wrong ?
I followed the tutorial from www.baeldung.com : https://www.baeldung.com/spring-rest-openapi-documentation.
I've seen that only springdoc v2 can be used with spring boot v3 : https://springdoc.org/v2/.
I add springdoc.enable-native-support=true to my application.properties according to : Using Springdoc with Spring Boot 3 Native but I get this error from JetBrains :
I tried to change dependencies and googling but nothing changes, I can't get my documentation.
Related
I made a package using Spring Boot Initalizer website with the following:
Kotlin
Gradle Kotlin
3.0.2
But I don't have the application properties file in my project. Where can I set the required properties ? Also, there is any documentation available with all of them ?
I tried searching on Google. But mostly are older versions of Spring Boot so that is not relevant
I tried searching on official website but nothing describes what I search.
Generated the spring boot app with same configuration using Spring Initializr.
The 'application.properties' file is present in src > main > resources folder.
Spring Initializr - Kotlin, Gradle
We're trying to upgrade spring boot version to 2.6.6 and faced up with "Spring Boot [2.6.6] is not compatible with this Spring Cloud release train" (when running integration tests).
In additional
spring-cloud.version = 2021
We're using org.springframework.cloud (spring-cloud-starter-openfeign & spring-cloud-openfeign-cores) 3.1.1
according to the documentation , spring boot support 2.6.6 should be compatible.
You could try and set your spring cloud version to
spring-cloud.version = 2021.0.1
If it is not that simple mistake I am sorry. The documentation that you linked to is correct. Spring Boot [2.6.6] is compatible with spring-cloud.version 2021.x.x. openfeign 3.1.1 is also part of springCloud 2021.x.x. I have multiple project with this configuration running. In all of them the runtime as well as the integration test are working properly. Otherwise a stacktrace would be nice to gain further information :)
I have multimodule project using maven.
After migrating for Spring-Boot version 2.4.2 to 2.6.6, I face multiple issues.
First one is the application won't be able to find the Bootstrap class. The error is:
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.Bootstrapper
To fix the issue I need to add the dependency in the pom.xml of the module:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
Second problem I face is to this "Spring Cloud release train"
In this case I need to upgrade the Spring-Cloud version to "2021.0.1" which is compatible with Spring-Boot 2.6.6
Third problem I face is this error while starting the application:
"No spring.config.import property has been defined"
The reason for this error is that some of the "bootstrap.properties" files are deprecated in the new version so application won't starts. To fix this, we need to add below property in application.properties or application.yml file.
spring.config.import=optional:configserver:
I've seen and tryed a lot of tutorial about spring-boot-starter-tomcat. But those worked for spring boot JPA but no for webflux.
Could you help me with that please?
Spring Boot does not support deploying a WebFlux application as a war file. If you want to use WebFlux, you should use jar packaging with an embedded container and launch your app using java -jar.
You can go through below link to understand the choices
webflux-server-choice
Can you please try this see that works?
compile('org.springframework.boot:spring-boot-starter-webflux') {
exclude group: 'org.springframework.boot',
module: 'spring-boot-starter-reactor-netty'
}
compile('org.springframework.boot:spring-boot-starter-tomcat')
This is what I found in this link
Learning Spring Boot 2.0 - Second Edition
Note: I am not sure about this is the right thing to do as I am not sure about the NIO capabilities of tomcat.
I am trying to deploy a spring boot , Java, Swagger application, everything is working fine except the swagger UI.
I am getting this below error.
File path not allowed: /swagger-ui.html
at com.amazonaws.serverless.proxy.internal.SecurityUtils.getValidFilePath
(SecurityUtils.java:192) ~[task/:na]
This is an old bug in Amazon's library.
<dependency>
<groupId>com.amazonaws.serverless</groupId>
<artifactId>aws-serverless-java-container-spring</artifactId>
</dependency>
Use the latest (or higher than 1.2).
https://github.com/awslabs/aws-serverless-java-container/pull/205
Its a configuration issue. You need to check the configuration part. I have mentioned few tutorials,have a look int it.
Configure Swagger With Jersey and Spring Boot
Spring Boot + Swagger2
How to add Swagger to Spring Boot -Video tutorial
How to configure Swagger in Spring Boot -Video tutorial
I'm trying to update my project to Spring Boot 1.4.0.RELEASE and Spring 4.3.2.RELEASE but it fails with a following errors:
The project was not built since its build path is incomplete:
Cannot find the class file for org.springframework.core.io.support.PropertySourceFactory.
Cannot find the class file for org.springframework.core.NestedRuntimeException.
Does Spring Boot 1.4.0.RELEASE support Spring 4.3.2.RELEASE and if so what am I doing wrong and how to fix it ?
See my answer here for someone trying to do the same. You basically have to use dependency management to get your dependencies straight.