I am currently working on the deployement of an application but for some reason it seems to not working perfectly.
While coding, I am running/debugging the project with Intellij Spring Boot runner which is easy to configure.
As I need to deploy on a Tomcat server, I tried to set up first in Intellij a Tomcat Server Runner before running my war from my Tomcat server directly.
Problem is: the run seems not to work properly. In fact, the application is not starting completly even if the deployement doesn't return any error.
Here is a Spring Boot runner output:
2020-02-19 11:50:18.373 DEBUG 1192 --- [ restartedMain] com.myapp.Application : Running with Spring Boot v2.2.4.RELEASE, Spring v5.2.3.RELEASE
2020-02-19 11:50:18.374 INFO 1192 --- [ restartedMain] com.myapp.Application : No active profile set, falling back to default profiles: default
2020-02-19 11:50:18.421 INFO 1192 --- [ restartedMain] o.s.b.devtools.restart.ChangeableUrls : The Class-Path manifest attribute in C:\Users\user\.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar referenced one or more files that do not exist: file:/C:/Users/user/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.xml.bind-api-2.3.2.jar,file:/C:/Users/user/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/txw2-2.3.2.jar,file:/C:/Users/user/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/istack-commons-runtime-3.0.8.jar,file:/C:/Users/user/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/stax-ex-1.8.1.jar,file:/C:/Users/user/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/FastInfoset-1.2.16.jar,file:/C:/Users/user/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.activation-api-1.2.1.jar
2020-02-19 11:50:18.422 INFO 1192 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2020-02-19 11:50:18.422 INFO 1192 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2020-02-19 11:50:19.223 INFO 1192 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2020-02-19 11:50:19.288 INFO 1192 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 57ms. Found 1 JPA repository interfaces.
2020-02-19 11:50:19.807 INFO 1192 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-19 11:50:20.115 INFO 1192 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http)
2020-02-19 11:50:20.125 INFO 1192 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-02-19 11:50:20.125 INFO 1192 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.30]
2020-02-19 11:50:20.233 INFO 1192 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
etc.
2020-02-19 11:50:24.396 INFO 1192 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2020-02-19 11:50:24.399 INFO 1192 --- [ restartedMain] com.myapp.Application : Started Application in 6.531 seconds (JVM running for 7.815)
And a Tomcat runner output:
2020-02-19 12:14:15.753 INFO 4436 --- [on(3)-127.0.0.1] com.myapp.Application : Starting Application on UO with PID 4436 (C:\App\apache-tomcat-8.0.47\webapps\server_war\WEB-INF\classes started by user in C:\App\apache-tomcat-8.0.47\bin)
2020-02-19 12:14:15.757 DEBUG 4436 --- [on(3)-127.0.0.1] com.myapp.Application : Running with Spring Boot v2.2.4.RELEASE, Spring v5.2.3.RELEASE
2020-02-19 12:14:15.760 INFO 4436 --- [on(3)-127.0.0.1] com.myapp.Application : No active profile set, falling back to default profiles: default
2020-02-19 12:14:15.937 INFO 4436 --- [on(3)-127.0.0.1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 113 ms
2020-02-19 12:14:15.994 INFO 4436 --- [on(3)-127.0.0.1] com.myapp.Application : Started Application in 1.045 seconds (JVM running for 7.228)
[2020-02-19 12:14:16,029] Artifact server:war: Artifact is deployed successfully
[2020-02-19 12:14:16,029] Artifact server:war: Deploy took 5,204 milliseconds
As you can see, Spring is launched correclty but seems to not proceed all its starting tasks.
I already have the spring-boot-starter-tomcat provided in my pom and here is my Application.class:
@SpringBootApplication public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(Application.class);
}
}
My questions are: Did I miss something in my configuration? How to run everything properly with Tomcat with multiple profiles (I am currently using VM options in the runner)?