Reputation: 8838
When I execute Run As -> Java application my Spring Boot application class on Eclipse, I get Spring Boot logo and version in logs but it halts and stops after few seconds:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
Spring version: 1.5.9.RELEASE
There are no errors in console.
Tried but didn't help:
gradle clean
, build
, eclipse
from command lineTried solutions from related SO threads:
Also:
gradle bootRun
, it runs smoothly.Why does it happen? How to solve it?
Upvotes: 5
Views: 13352
Reputation: 3510
I encountered this when running a natively compiled binary in SpringBoot 3.2.2. When building with ./gradlew nativeBuild
and executing build/native/nativeCompile/appname
.
I am using an external build script that I get from Nexus as a dependency and apply in my build.gradle
. My problem was that I applied the org.graalvm.buildtools.native
that build script and the SpringBoot plugin org.springframework.boot
in build.gradle
. This will cause classloader issue when the 2 plugins do not use the same classloader.
I solved it by applying both plugins in build.gradle
.
I was helped by this comment: https://github.com/spring-projects/spring-boot/issues/34758#issuecomment-1483178673
Upvotes: 0
Reputation: 162
In my case, my spring boot application was out of application.properties
, so I just added it back and it worked fine.
Upvotes: 0
Reputation: 89
I had this issue from upgrading the slf4j-api
dependency from 1.X
to 2.0.6
. We were able to resolve by adding slf4j-simple:2.0.6
dependency as well. The slf4j patch notes for version 2.0
go over this topic here. Spring hanging on the logo appears to be an additional side effect.
slf4j-api version | slf4j-simple version | Result | Explanation |
---|---|---|---|
2.0.x | 2.0.x | OK | Same version for slf4j-api and provider |
1.7.x | 2.0.x | no bindings can be found warning message | 2.0.x providers do not act as 1.7.x/1.6.x compatible bindings |
2.0.x | 1.7.x | no providers can be found warning message | slf4j-api 2.0.x will no longer search for StaticLoggerBinding |
Upvotes: 0
Reputation: 961
If the answers above are not satisfactory the issue in my case was that I was including dependency with its own slf4j setup, that got in clash with Spring Boot's one (old vs. new).
The problem was that the dependency was accidentally built as fat-jar.
Upvotes: 1
Reputation: 2907
in my case the reason was that I was using an alpha release of sl4j. When i replaced it with an older one I was able to start the spring boot application.
Upvotes: 0
Reputation: 1323
In my case It was fixed when added the spring boot web dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Upvotes: 2
Reputation: 4115
Spring Boot is still working, just there is no output in the console after logo. Server will startup if there are no other issues.
In my case Spring Boot console stopped logging after i renamed application.properties into core.properties (that file is referred in logback.xml)
<define name="internalFile" class="ch.qos.logback.core.property.ResourceExistsPropertyDefiner">
<resource>application.properties</resource>
</define>
After updating the resource tag, console output was back.
Upvotes: 0
Reputation: 8838
Deleted logback.xml
from src/main/resources
and logback-test.xml
from src/test/resources
and it worked.
Upvotes: 16