SpringBoot application stuck at springboot logo
Asked Answered
D

4

23

I have spring boot application integrated with jersey framework. Now when I try to run that application it just stucks at Spring boot logo and nothing happens after that.

I tried adding -X also , but no logs appear after logo.I tried many changes to my pom but with same result. I cannt proceed further as I am not able to figure out error information.

Any guess how can I debug this issue, I cannot share my code right now.

[Update] I somehow managed to run the applicaton.Now it goes beyond Sprint Logo

I can see application is started but I am not able to see tomcat starting logs and it just hangs there..

Is it could be issue with using tomcat with springboot and jersy

Dew answered 23/11, 2016 at 10:57 Comment(9)
What type of logging do you use?!.. do you have a log4j file in you application ?!..Portauprince
yes I am using log4j ,private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(JerseyApplication.class);Dew
Can you post your Logging preferences from application.properties??Lowermost
<included> <logger name="abc.poc" level="DEBUG" /> </included>Dew
post your entire log4j file make the root logger to debugPortauprince
please post your springboot starting logsHumphrey
@Alien01 Were you able to resolve this? I'm facing a similar issue now.Abell
@anand, how you are starting the application?Lordling
I had this issue because I wasn't setting the spring boot profile.Eliason
K
19

I was also facing this:

Resolved it by adding "console" config in log4j2.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <Configuration status="info" packages="com.citi.area51">
<Appenders>
    <Console name="Console" target="SYSTEM_OUT">
        <PatternLayout pattern="%d{dd/MM/yyyy HH:mm:ss.SSSSSS} [%t] %-5level 
%logger{36} - %msg%n"/>
    </Console>
</Appenders>
<Loggers>
    <Root level="info">
        <AppenderRef ref="Console"/>
        <AppenderRef ref="File"/>
    </Root>
</Loggers>
</Configuration>
Kootenay answered 3/10, 2017 at 8:25 Comment(2)
Mine was a port already in use..but the key is to get logging wired to see the issue. Thanks!Rameriz
Thanks. Had some trouble finding the file which was under src\main\resources for me.Elemi
G
7

The same issue happened to me after I added the following logback.xml configuration, because I wanted to limit the noise produced by apache http client:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <logger name="org.apache" level="ERROR" />
  <logger name="httpclient" level="ERROR" />
</configuration>

When I added appender and root logger, my app started working again.

  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>

  <root level="info">
    <appender-ref ref="STDOUT" />
  </root>

So, if you are facing this issue, check configuration of your loggers.

Hope it helps someone!

Galvani answered 15/1, 2020 at 14:45 Comment(0)
D
1

It happens to me everytime I forget to configure a profile for the current execution, as Spring expects you to explicitly provide it.

Specifically: when executing in local Spring boot expects you to provide the following environment variable:

spring.profiles.active=local

You can provide it as well as a default execution profile by adding the following snippet in your application.yml:

spring:
  profiles:
    active: local

Otherwise you would have to configure your own profiles in the code and still explicitly request them when executing your app in the same way as above described for the local profile

Davie answered 26/4, 2023 at 14:33 Comment(0)
E
0

It is an old question but I faced this issue now. For me the logging configurations were correct, but I forgot to activate any Spring profile (and the logging config was tied to certain profiles).

I had to activate the correct profiles with -Dspring.profiles.active VM argument (SPRING_PROFILES_ACTIVE environment variable should also work).

So if your logging config is based on Spring profiles check your active profiles!

Escarp answered 13/9, 2023 at 8:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.