I am trying to get a spring-boot application to run. However with my current settings I keep getting errors.
Java 8
Maven 3.6.1
Environment Variables checked
As of the new version 2.2.1 of spring-boot I keep getting the same error on closing the built-in tomcat.
I have a sample Spring-Boot Application which I can't seem to run properly. Took a clean version from spring initializr.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.547 s
[INFO] Finished at: 2019-11-07T22:28:54+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.1.RELEASE:run (default-cli) on project java13-app: Application finished with exit code: 1 -> [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/MojoExecutionException
When I go back to Spring 2.1.10 I get the following output.:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.10.RELEASE)
2019-11-07 22:38:33.194 INFO 2572 --- [ main] test.Application : Starting Application on DP-BTO-Tom with PID 2572 (Y:\tbrx\java-13-spring-boot\target\classes started by Tom in Y:\tbrx\java-13-spring-boot)
2019-11-07 22:38:33.196 INFO 2572 --- [ main] test.Application : No active profile set, falling back to default profiles: default
2019-11-07 22:38:33.966 INFO 2572 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-11-07 22:38:33.986 INFO 2572 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-11-07 22:38:33.986 INFO 2572 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.27]
2019-11-07 22:38:34.053 INFO 2572 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-11-07 22:38:34.054 INFO 2572 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 832 ms
2019-11-07 22:38:34.221 INFO 2572 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-11-07 22:38:34.361 INFO 2572 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-11-07 22:38:34.364 INFO 2572 --- [ main] test.Application : Started Application in 1.542 seconds (JVM running for 4.547)
2019-11-07 22:38:35.652 INFO 2572 --- [ Thread-5] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
[Terminate batch job (Y/N)? y
Instead of a build failure.
Asked, fixed and closed as a bug in Spring Boot - 2.2.1
https://github.com/spring-projects/spring-boot/issues/18936#event-2782909196
Related
Is there a way to suspend java ( springboot ) unit tests execution when running mvn test and resume them later ?
So I have this test class :
#SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
class JavaAppApplicationTests {
#Test
void contextLoads() {}
#Test
#RepeatedTest(10)
public void testApplication() {
JavaAppApplication javaApp = new JavaAppApplication();
String result = javaApp.sanitize();
assertEquals(result, "{\"key1\":\"value1\",\"type\":\"Booking\",\"sid\":\"A435211\",\"region\":\"ASIA\",\"fetchFromFile\":\"false\",\"service\":\"true\",\"isEom\":\"true\"}");
}
}
And when I run mvn test, I see in the console logs the following :
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.6.6)
2022-05-17 11:00:29.481 INFO 58143 --- [ main] c.e.javaapp.JavaAppApplicationTests : Starting JavaAppApplicationTests using Java 17-internal on neo-VirtualBox with PID 58143 (started by neo in /home/neo/Desktop/spring-vulnerable-app)
2022-05-17 11:00:29.483 INFO 58143 --- [ main] c.e.javaapp.JavaAppApplicationTests : No active profile set, falling back to 1 default profile: "default"
2022-05-17 11:00:30.542 INFO 58143 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-05-17 11:00:30.561 INFO 58143 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-05-17 11:00:30.561 INFO 58143 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.60]
2022-05-17 11:00:30.749 INFO 58143 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-05-17 11:00:30.749 INFO 58143 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1230 ms
2022-05-17 11:00:31.497 INFO 58143 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2022-05-17 11:00:31.507 INFO 58143 --- [ main] c.e.javaapp.JavaAppApplicationTests : Started JavaAppApplicationTests in 2.452 seconds (JVM running for 3.887)
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4 s - in com.elastisys.javaapp.JavaAppApplicationTests
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0
The JavaApplicationTests is started with a specific PID and a defined port and then tests are executed.
What I am looking for is a way to start the application and wait for a specific period before executing all the tests ( like it's suspended )
Thanks in advance
I have created a Spring Boot Application with Spring Initializr. I use Spring Data with MySQL JDBC Connection. I created an docker image with gradle bootBuildImage and start this docker image with docker run --rm -p 8080:80 buchschrank:0.0.1-SNAPSHOT. But startup needs about 2-3 seconds instead of milliseconds:
2021-11-09 16:03:32.238 INFO 1 --- [ main] o.s.nativex.NativeListener : This application is bootstrapped with code generated with Spring AOT
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.5.6)
2021-11-09 16:03:32.277 INFO 1 --- [ main] o.s.boot.SpringApplication : Starting application using Java 11.0.13 on 2b2e5a51334b with PID 1 (started by cnb in /workspace)
2021-11-09 16:03:32.277 INFO 1 --- [ main] o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default
2021-11-09 16:03:32.326 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-11-09 16:03:32.329 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 2 ms. Found 1 JPA repository interfaces.
2021-11-09 16:03:32.388 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 80 (http)
2021-11-09 16:03:32.389 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-11-09 16:03:32.389 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.54]
2021-11-09 16:03:32.395 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-11-09 16:03:32.395 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 116 ms
2021-11-09 16:03:32.412 INFO 1 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-11-09 16:03:32.414 INFO 1 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.32.Final
2021-11-09 16:03:32.415 INFO 1 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-11-09 16:03:32.417 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-11-09 16:03:33.840 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-11-09 16:03:33.842 INFO 1 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
2021-11-09 16:03:34.973 INFO 1 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-11-09 16:03:34.974 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-11-09 16:03:35.033 WARN 1 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-11-09 16:03:35.077 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 80 (http) with context path ''
2021-11-09 16:03:35.078 INFO 1 --- [ main] o.s.boot.SpringApplication : Started application in 2.852 seconds (JVM running for 2.854)
The sourcecode of my example application: https://github.com/lesestunden/buchschrank-backend
Any idea what is wrong with my application setup? Thanks a lot!
Reason was slow initial connection to database. With local running mysql database startup is around 200ms.
I try to connect spring app with postgresql.
When I run my app directly on server(not container), Connection success.
java -jar app.jar
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.4.5)
2021-07-05 14:10:58.348 INFO 334534 --- [ main] com.studb.poemNote.PoemNoteApplication : Starting PoemNoteApplication v1 using Java 11.0.11 on ip-172-31-3-67 with PID 334534 (/home/ubuntu/poemnote/poemNote/target/poemNote-1.jar started by ubuntu in /home/ubuntu/poemnote/poemNote)
2021-07-05 14:10:58.355 INFO 334534 --- [ main] com.studb.poemNote.PoemNoteApplication : No active profile set, falling back to default profiles: default
2021-07-05 14:11:00.447 INFO 334534 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JDBC repositories in DEFAULT mode.
2021-07-05 14:11:00.498 INFO 334534 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 46 ms. Found 0 JDBC repository interfaces.
2021-07-05 14:11:01.903 INFO 334534 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9000 (http)
2021-07-05 14:11:01.936 INFO 334534 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-07-05 14:11:01.936 INFO 334534 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.45]
2021-07-05 14:11:02.095 INFO 334534 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-07-05 14:11:02.095 INFO 334534 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3595 ms
2021-07-05 14:11:02.945 INFO 334534 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-07-05 14:11:03.197 INFO 334534 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-07-05 14:11:04.497 INFO 334534 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-07-05 14:11:04.762 INFO 334534 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]
2021-07-05 14:11:05.241 INFO 334534 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9000 (http) with context path ''
2021-07-05 14:11:05.267 INFO 334534 --- [ main] com.studb.poemNote.PoemNoteApplication : Started PoemNoteApplication in 8.396 seconds (JVM running for 9.694)
^C2021-07-05 14:11:13.986 INFO 334534 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
But when i run container, connection fail like below
docker run -p port:port
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.4.5)
2021-07-05 14:12:37.130 INFO 1 --- [ main] com.studb.poemNote.PoemNoteApplication : Starting PoemNoteApplication v1 using Java 11.0.11 on de04c6a415a5 with PID 1 (/app/BOOT-INF/classes started by root in /app)
2021-07-05 14:12:37.139 INFO 1 --- [ main] com.studb.poemNote.PoemNoteApplication : No active profile set, falling back to default profiles: default
2021-07-05 14:12:38.997 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JDBC repositories in DEFAULT mode.
2021-07-05 14:12:39.055 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 47 ms. Found 0 JDBC repository interfaces.
2021-07-05 14:12:40.351 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9000 (http)
2021-07-05 14:12:40.383 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-07-05 14:12:40.383 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.45]
2021-07-05 14:12:40.516 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-07-05 14:12:40.516 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3260 ms
2021-07-05 14:12:41.248 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-07-05 14:12:52.405 ERROR 1 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315) ~[postgresql-42.2.19.jar:42.2.19]
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51) ~[postgresql-42.2.19.jar:42.2.19]
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223) ~[postgresql-42.2.19.jar:42.2.19]
at org.postgresql.Driver.makeConnection(Driver.java:465) ~[postgresql-42.2.19.jar:42.2.19]
at org.postgresql.Driver.connect(Driver.java:264) ~[postgresql-42.2.19.jar:42.2.19]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-3.4.5.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:358) ~[HikariCP-3.4.5.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-3.4.5.jar:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:477) ~[HikariCP-3.4.5.jar:na]
It's my dockerfile
FROM adoptopenjdk:11-jre-hotspot as builder
WORKDIR app
ARG JAR_FILE=target/*jar
COPY ${JAR_FILE} app.jar
RUN java -Djarmode=layertools -jar app.jar extract
FROM adoptopenjdk:11-jre-hotspot
WORKDIR app
COPY --from=builder app/dependencies/ ./
COPY --from=builder app/spring-boot-loader/ ./
COPY --from=builder app/snapshot-dependencies/ ./
COPY --from=builder app/application/ ./
EXPOSE 9000
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
I can't understand why it does...
I try run container '--network host' but it's failed.
Postgresql running inside container on the same host
In case postgresql is also running inside a container of the same host, you need to make sure that they share the same network and that the containers can reach each other.
Check configured networks of the container:
docker inspect <container> -f "{{json .NetworkSettings.Networks }}"
Check if you can reach one container from the another:
docker exec -u 0 <container1> ping <container2> -c2
In case they are not on the same network, you need to create the network first and then connect the containers to it:
docker network create <network>
and
docker network connect <network> <container>
Postgresql running directly on the host
In case postgresql is running directly on the host where your docker container is running, you need to make sure that you can reach the host system from your container. Try to add the following command when you start the container
--add-host=host.docker.internal:host-gateway
Useful Links:
How to access host port from docker container
Docker : How to find the network my container is in?
https://docs.docker.com/network/
https://docs.docker.com/network/bridge/
I have a spring-boot project which uses spring-cloud to manage the properties in a centralized place.
I have configured the app as below
#SpringBootApplication
#EnableConfigServer
public class ConfigServerApplication {
public static void main( String[] args )
{
SpringApplication.run(ConfigServerApplication.class, args);
}
}
and the application.properties as below
spring.application.name=spring-cloud-config-server
server.port=8888
spring.cloud.config.server.git.uri=file:///ebs/payment-config-server-git
But when I run the jar, the application log stops at,
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.0.RELEASE)
2020-06-08 19:36:38.641 INFO 4278 --- [ main] c.h.t.c.ConfigServerApplication : No active profile set, falling back to default profiles: default
2020-06-08 19:36:40.303 INFO 4278 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=cb4015b1-4a5b-3c4c-a050-3196b94db932
2020-06-08 19:36:40.973 INFO 4278 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8888 (http)
2020-06-08 19:36:41.001 INFO 4278 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-06-08 19:36:41.002 INFO 4278 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.35]
2020-06-08 19:36:41.128 INFO 4278 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-06-08 19:36:41.128 INFO 4278 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2460 ms
2020-06-08 19:36:41.608 INFO 4278 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-06-08 19:36:42.649 INFO 4278 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2020-06-08 19:36:42.718 INFO 4278 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8888 (http) with context path ''
2020-06-08 19:36:42.738 INFO 4278 --- [ main] c.h.t.c.ConfigServerApplication : Started ConfigServerApplication in 5.573 seconds (JVM running for 6.371)
It is supposed to log the repository location from where it reads the properties from. But it is not printing those logs and I am not able to read any properties from the application.
What is the mistake in my configuration file?
Thank You.
PS: Git origin is not set. There is no remote for the git repository
This question already has answers here:
Why does my Spring Boot App always shutdown immediately after starting?
(23 answers)
Closed 7 years ago.
Like the title said, I right click on the spring boot project and Run as Spring Boot App. This is what I saw in the Console window of STS:
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.3.2.RELEASE)
2016-01-30 21:06:29.124 INFO 6584 --- [ main] l.IssueManagerApplication : Starting IssueManagerApplication on LVN with PID 6584 (E:\_WORKSPACE\SPRING_BOOT\issue-manager\target\classes started by Le in E:\_WORKSPACE\SPRING_BOOT\issue-manager)
2016-01-30 21:06:29.130 INFO 6584 --- [ main] l.IssueManagerApplication : No active profile set, falling back to default profiles: default
2016-01-30 21:06:29.249 INFO 6584 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#12d575ec: startup date [Sat Jan 30 21:06:29 EET 2016]; root of context hierarchy
2016-01-30 21:06:31.208 INFO 6584 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2016-01-30 21:06:32.032 INFO 6584 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-01-30 21:06:32.077 INFO 6584 --- [ main] l.IssueManagerApplication : Started IssueManagerApplication in 4.163 seconds (JVM running for 6.548)
2016-01-30 21:06:32.078 INFO 6584 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext#12d575ec: startup date [Sat Jan 30 21:06:29 EET 2016]; root of context hierarchy
2016-01-30 21:06:32.084 INFO 6584 --- [ Thread-2] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
And when I open localhost:8080, it just displayed a grey page saying "This webpage is not available". Apparently the server does not start at all or it started but then stopped right after that.
I already tried run mvn spring-boot:run, it also log out information as above plus BUILD SUCCESS and stops even without me Ctrl + C. So I dont know how to run my "hello world" spring-boot application.
I resolved the issue by adding this in my pom.xml:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Thanks to this post:
Why my Spring Boot App always shutdown