Spring boot stops after starting on server - java

When I trying to deploy jar file on server at that time it is deployed successfully and then I execute startup.sh file after that spring boot application is start the execution but after execute bellow logs server is not responding any more.
[2016-07-15 11:01:38.714] boot - 14956 INFO [main] --- TomcatEmbeddedServletContainer: Tomcat started on port(s): 8084 (http)
[2016-07-15 11:01:38.723] boot - 14956 INFO [main] --- Application: Started Application in 64.717 seconds (JVM running for 67.138)
[2016-07-15 11:01:44.688] boot - 14956 INFO [Thread-4] --- AnnotationConfigEmbeddedWebApplicationContext: Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#64375c2a: startup date [Fri Jul 15 11:00:38 EDT 2016]; root of context hierarchy
[2016-07-15 11:01:44.692] boot - 14956 INFO [Thread-4] --- DefaultLifecycleProcessor: Stopping beans in phase 0
[2016-07-15 11:01:44.752] boot - 14956 INFO [Thread-4] --- AnnotationMBeanExporter: Unregistering JMX-exposed beans on shutdown
[2016-07-15 11:01:44.810] boot - 14956 INFO [Thread-4] --- LocalContainerEntityManagerFactoryBean: Closing JPA EntityManagerFactory for persistence unit 'default'
Also attached screenshot here.
Please Guide,
Thanks.

If you are using Maven add this to your pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
It should work.

Related

Spring boot executes without error, however, no tables are created on the server

Most of the code is copied from the old projects, except this time I use Gradle instead of maven.
When I run the project on my local machine via IntelliJ, the new tables are created and everything works.
However, when I upload it to tomcat, I don't see the tables on the database.
When I check the endpoints and try to save new data, it is possible and after saving I can access them.
While the project is in tomcat, the data is accessible. As soon as I reload/undeploy and deploy again, the data is lost and I can't access the data via services. Until I save new data.
Maybe it has something to do with "in-memory databases".
application.properties:
spring.jpa.hibernate.ddl-auto=update
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/database_name?autoReconnect=true&useSSL=false&createDatabaseIfNotExist=true
spring.datasource.username=username
spring.datasource.password=password
spring.jta.enabled=true
spring.datasource.hikari.minimum-idle=10
spring.datasource.hikari.maximum-pool-size=300
spring.datasource.hikari.idleTimeout=30000
spring.datasource.hikari.maxLifetime=2000000
spring.datasource.hikari.connectionTimeout=30000
I checked for hours and couldn't find the problem.
I log into the server and checked the catalina logs, no error messages. They are more or less identical until the point where the IntelliJ creates the tables, it is missing on Catalina.out.
org.hibernate.SQL : create table table_name ...
Main class is in package x.y, and entities are in x.y.database.tables.
log from catalina.out:
30-May-2021 23:15:40.921 INFO [ajp-nio-8009-exec-356] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
30-May-2021 23:15:41.009 INFO [ajp-nio-8009-exec-356] org.apache.catalina.core.ApplicationContext.log 2 Spring WebApplicationInitializers detected on classpath
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.5.0)
2021-05-30 23:15:41.778 INFO 1454 --- [o-8009-exec-356] com.global.ServletInitializer : Starting ServletInitializer using Java 1.8.0_292 on ubuntu-droplet1 with PID 1454 (/opt/tomcat/temp/50-global##10049/WEB-INF/classes started by tomcat in /)
2021-05-30 23:15:41.782 INFO 1454 --- [o-8009-exec-356] com.global.ServletInitializer : No active profile set, falling back to default profiles: default
2021-05-30 23:15:42.051 WARN 1454 --- [kground-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
2021-05-30 23:15:43.027 INFO 1454 --- [o-8009-exec-356] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-05-30 23:15:43.150 INFO 1454 --- [o-8009-exec-356] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 105 ms. Found 1 JPA repository interfaces.
30-May-2021 23:15:43.881 INFO [ajp-nio-8009-exec-356] org.apache.catalina.core.ApplicationContext.log Initializing Spring embedded WebApplicationContext
2021-05-30 23:15:43.881 INFO 1454 --- [o-8009-exec-356] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2023 ms
2021-05-30 23:15:43.931 TRACE 1454 --- [o-8009-exec-369]
2021-05-30 23:15:44.372 INFO 1454 --- [o-8009-exec-356] com.zaxxer.hikari.HikariDataSource : HikariPool-28 - Starting...
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2021-05-30 23:15:44.704 INFO 1454 --- [o-8009-exec-356] com.zaxxer.hikari.HikariDataSource : HikariPool-28 - Start completed.
2021-05-30 23:15:44.796 INFO 1454 --- [o-8009-exec-356] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-05-30 23:15:44.910 INFO 1454 --- [o-8009-exec-356] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.31.Final
2021-05-30 23:15:45.199 INFO 1454 --- [o-8009-exec-356] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-05-30 23:15:45.504 INFO 1454 --- [o-8009-exec-356] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2021-05-30 23:15:46.812 INFO 1454 --- [o-8009-exec-356] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-05-30 23:15:46.829 INFO 1454 --- [o-8009-exec-356] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-05-30 23:15:47.884 WARN 1454 --- [o-8009-exec-356] 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-05-30 23:15:48.265 INFO 1454 --- [o-8009-exec-356] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/**'], [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#1177a1e1, org.springframework.security.web.context.SecurityContextPersistenceFilter#3f4454d9, org.springframework.security.web.header.HeaderWriterFilter#132a4fd3, org.springframework.security.web.authentication.logout.LogoutFilter#24276bb0, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#5f273afb, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#5ef67d5b, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#7361a373, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#5e9936ce, org.springframework.security.web.session.SessionManagementFilter#3e4a0114, org.springframework.security.web.access.ExceptionTranslationFilter#14437cb5, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#1ca8217d]
2021-05-30 23:15:49.023 INFO 1454 --- [o-8009-exec-356] com.global.ServletInitializer : Started ServletInitializer in 7.871 seconds (JVM running for 24656.257)
2021-05-30 23:15:49.025 INFO 1454 --- [o-8009-exec-356] o.s.b.a.ApplicationAvailabilityBean : Application availability state LivenessState changed to CORRECT
2021-05-30 23:15:49.028 INFO 1454 --- [o-8009-exec-356] o.s.b.a.ApplicationAvailabilityBean : Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
30-May-2021 23:15:49.036 INFO [ajp-nio-8009-exec-356] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/some_name/global##10049.war] has finished in [11,445] ms
30-May-2021 23:15:49.036 INFO [ajp-nio-8009-exec-356] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host '**domain**'
30-May-2021 23:16:01.419 INFO [ajp-nio-8009-exec-369] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host '**domain**'
30-May-2021 23:16:02.012 INFO [ajp-nio-8009-exec-372] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host '**domain**'
30-May-2021 23:16:04.502 INFO [ajp-nio-8009-exec-371] org.apache.catalina.core.ApplicationContext.log Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-05-30 23:16:04.503 INFO 1454 --- [o-8009-exec-371] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2021-05-30 23:16:04.505 INFO 1454 --- [o-8009-exec-371] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms
You're missing on some configuration, for example generate-dll. Try with the following:
spring.datasource.url=jdbc:mysql://localhost:3306/dbName
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=username
spring.datasource.password=password
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
I've used different driver class, because the one from your properties is deprecated (which is unrelated to your problem).
P.S.: I agree with the comments - update shouldn't be used in production. I wouldn't even rely on hibernate to manage the schema of my database, but rather use tools like flyway / liquibase.
The problem which you are facing is a classic issue. Before rectifying this issue let me tell you that there are few coding standards which are missing here. Solving this would help you create a robust and close to production-ready code.
Spring boot comes with embedded tomcat. So you don't need to upload the artifact to another tomcat server. (Correct me if I have got it wrong. You can use this command to start the server java -jar <JAR_FILE_NAME>.jar)
Manage your database separately. You could use Flyway or Liquibase to handle database migration. This way your schema will be clean. With this you could change spring.jpa.hibernate.ddl-auto to validate or totally get rid if this property.
Add spring.jpa.show-sql=true to log the database queries (Used for debugging and not in production).
Addressing your query.
Please get rid of the spring.jpa.hibernate.ddl-auto and use the latest mysql driver which is com.mysql.cj.jdbc.Driver.
Also make sure that you are checking the right database for the data. (Also you could get rid of any additional dependencies in your project which you are not using. Like H2 database which corresponds to in-memory DB. This is unlikely as the logs are clearly showing the driver used is for Mysql.)

Spring Boot War Deployment on Tomcat not working

I deployed a springboot application package in WAR format. But I am not seeing the spring related logs in my console. Also, I cannot see the application running. What could be the possible reason? I am attaching the tomcat logs herewith. Thanks in advance
2020-07-02 17:22:17.744 INFO 17952 --- [ost-startStop-1] c.s.narayaneeyam.ServletInitializer : Starting ServletInitializer v0.0.1-SNAPSHOT on DESKTOP-PB6GB90 with PID 17952 (D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\narayaneeyam-0.0.1-SNAPSHOT\WEB-INF\classes started by sachi in D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\bin)
2020-07-02 17:22:17.754 INFO 17952 --- [ost-startStop-1] c.s.narayaneeyam.ServletInitializer : No active profile set, falling back to default profiles: default
2020-07-02 17:22:20.982 INFO 17952 --- [ost-startStop-1] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
2020-07-02 17:22:21.248 INFO 17952 --- [ost-startStop-1] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 227ms. Found 4 JPA repository interfaces.
2020-07-02 17:22:22.688 INFO 17952 --- [ost-startStop-1] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4795 ms
2020-07-02 17:22:23.760 INFO 17952 --- [ost-startStop-1] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-07-02 17:22:23.944 INFO 17952 --- [ task-1] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2020-07-02 17:22:24.042 WARN 17952 --- [ost-startStop-1] 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
2020-07-02 17:22:24.172 INFO 17952 --- [ost-startStop-1] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: 3c2c7634-78d3-4015-ab8e-c9a6c99c4b3b
2020-07-02 17:22:24.288 INFO 17952 --- [ task-1] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.17.Final
2020-07-02 17:22:25.162 INFO 17952 --- [ task-1] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-07-02 17:22:25.745 INFO 17952 --- [ task-1] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-07-02 17:22:26.474 INFO 17952 --- [ task-1] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-07-02 17:22:26.573 INFO 17952 --- [ task-1] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2020-07-02 17:22:26.621 INFO 17952 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#2e78fc6, org.springframework.security.web.context.SecurityContextPersistenceFilter#5adbbfc, org.springframework.security.web.header.HeaderWriterFilter#5e4ef05f, org.springframework.security.web.csrf.CsrfFilter#6f946b3c, org.springframework.security.web.authentication.logout.LogoutFilter#61bb46d, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#5dcf9e1a, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#5a5ac80e, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter#4fb155f8, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#54779eb2, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#39715673, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#6708ba7c, org.springframework.security.web.session.SessionManagementFilter#53fa3c7e, org.springframework.security.web.access.ExceptionTranslationFilter#e50c54, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#50b9a845]
2020-07-02 17:22:29.827 INFO 17952 --- [ task-1] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2020-07-02 17:22:29.865 INFO 17952 --- [ task-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-07-02 17:22:29.994 INFO 17952 --- [ost-startStop-1] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2020-07-02 17:22:30.060 INFO 17952 --- [ost-startStop-1] DeferredRepositoryInitializationListener : Triggering deferred initialization of Spring Data repositoriesà
2020-07-02 17:22:31.170 INFO 17952 --- [ost-startStop-1] DeferredRepositoryInitializationListener : Spring Data repositories initialized!
2020-07-02 17:22:31.187 INFO 17952 --- [ost-startStop-1] c.s.narayaneeyam.ServletInitializer : Started ServletInitializer in 14.858 seconds (JVM running for 42.474)
02-Jul-2020 17:22:31.264 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\narayaneeyam-0.0.1-SNAPSHOT.war] has finished in [41,103] ms
02-Jul-2020 17:22:31.283 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\docs]
02-Jul-2020 17:22:31.316 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\docs] has finished in [33] ms
02-Jul-2020 17:22:31.316 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\examples]
02-Jul-2020 17:22:32.114 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\examples] has finished in [798] ms
02-Jul-2020 17:22:32.115 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\host-manager]
02-Jul-2020 17:22:32.155 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\host-manager] has finished in [40] ms
02-Jul-2020 17:22:32.156 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\manager]
02-Jul-2020 17:22:32.201 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\manager] has finished in [45] ms
02-Jul-2020 17:22:32.201 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\ROOT]
02-Jul-2020 17:22:32.236 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat\apache-tomcat-8.5.56-windows-x64\apache-tomcat-8.5.56\webapps\ROOT] has finished in [35] ms
02-Jul-2020 17:22:32.242 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
02-Jul-2020 17:22:32.257 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 42167 ms
These are are all spring's logs:
2020-07-02 17:22:20.982 INFO 17952 --- [ost-startStop-1] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
2020-07-02 17:22:21.248 INFO 17952 --- [ost-startStop-1] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 227ms. Found 4 JPA repository interfaces.
2020-07-02 17:22:26.621 INFO 17952 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#2e78fc6, org.springframework.security.web.context.SecurityContextPersistenceFilter#5adbbfc, org.springframework.security.web.header.HeaderWriterFilter#5e4ef05f, org.springframework.security.web.csrf.CsrfFilter#6f946b3c, org.springframework.security.web.authentication.logout.LogoutFilter#61bb46d, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#5dcf9e1a, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#5a5ac80e, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter#4fb155f8, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#54779eb2, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#39715673, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#6708ba7c, org.springframework.security.web.session.SessionManagementFilter#53fa3c7e, org.springframework.security.web.access.ExceptionTranslationFilter#e50c54, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#50b9a845]
2020-07-02 17:22:29.994 INFO 17952 --- [ost-startStop-1] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
o.s.d.r.c means org.springframework.data.repository.config
o.s.s.web means org.springframework.security.web
So these are all logs from Spring's classes.
If you want to see more spring logs, just set the log level to debug in application.yaml:
logging:
level:
org.springframework.boot: debug

camunda spring boot starter with gradle gives processEngineConfigurationImpl bean missing

My issue is quite similar to this one and it's kinda straightforward: copy paste service from maven to gradle project makes starters non operational.
Here is the project I've used as an example and it starts like a charm:
Spring-Boot: (v2.2.5.RELEASE)
Camunda BPM: (v7.12.0)
Camunda BPM Spring Boot Starter: (v3.4.1)
INFO 227460 --- [main] com.camunda.demo.springboot.Application : Starting Application on archbox with PID 227460 (/home/user/ide/IdeaProjects/camunda-spring-boot-amqp-microservice-cloud-example/target/classes started by user in /home/user/ide/IdeaProjects/camunda-spring-boot-amqp-microservice-cloud-example)
INFO 227460 --- [main] com.camunda.demo.springboot.Application : No active profile set, falling back to default profiles: default
INFO 227460 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
INFO 227460 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
INFO 227460 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.31]
INFO 227460 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
INFO 227460 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1095 ms
INFO 227460 --- [main] .c.b.s.b.s.r.CamundaJerseyResourceConfig : Configuring camunda rest api.
INFO 227460 --- [main] .c.b.s.b.s.r.CamundaJerseyResourceConfig : Finished configuring camunda rest api.
INFO 227460 --- [main] org.camunda.bpm.spring.boot : STARTER-SB040 Setting up jobExecutor with corePoolSize=3, maxPoolSize:10
INFO 227460 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'camundaTaskExecutor'
INFO 227460 --- [main] org.camunda.bpm.engine.cfg : ENGINE-12003 Plugin 'CompositeProcessEnginePlugin[genericPropertiesConfiguration, camundaEngineHistoryConfiguration, camundaIdGeneratorConfiguration, camundaProcessEngineConfiguration, camundaDatasourceConfiguration, camundaJobConfiguration, camundaHistoryConfiguration, camundaMetricsConfiguration, camundaAuthorizationConfiguration, failedJobConfiguration, SendEventListenerPlugin, disableDeploymentResourcePattern, eventPublisherPlugin]' activated on process engine 'default'
INFO 227460 --- [main] org.camunda.bpm.spring.boot : STARTER-SB020 ProcessApplication enabled: autoDeployment via springConfiguration#deploymentResourcePattern is disabled
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-001: Initialized Camunda Spring Boot Eventing Engine Plugin.
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-003: Task events will be published as Spring Events.
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-005: Execution events will be published as Spring Events.
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-007: History events will be published as Spring events.
INFO 227460 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
INFO 227460 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
INFO 227460 --- [main] org.camunda.bpm.engine : ENGINE-00001 Process Engine default created.
INFO 227460 --- [main] o.c.b.s.b.s.w.f.LazyInitRegistration : lazy initialized org.camunda.bpm.spring.boot.starter.webapp.filter.LazyProcessEnginesFilter#69364b2d
INFO 227460 --- [main] o.c.b.s.b.s.w.f.LazyInitRegistration : lazy initialized org.camunda.bpm.spring.boot.starter.webapp.filter.LazySecurityFilter#52f6900a
However project I've copied from part of sources gives following:
Spring-Boot: (v2.1.3.RELEASE)
Camunda BPM: (v7.12.0)
Camunda BPM Spring Boot Starter: (v3.4.1)
INFO 227891 --- [main] com.test.camundatest.Application : Starting Application on archbox with PID 227891 (/home/user/ide/IdeaProjects/gradle-camunda-service/build/classes/java/main started by user in /home/user/ide/IdeaProjects/gradle-camunda-service)
INFO 227891 --- [main] com.test.camundatest.Application : No active profile set, falling back to default profiles: default
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 14ms. Found 0 repository interfaces.
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 3ms. Found 0 repository interfaces.
INFO 227891 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$d980ca4f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 227891 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
INFO 227891 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
INFO 227891 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16]
INFO 227891 --- [main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
INFO 227891 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
INFO 227891 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1883 ms
ERROR 227891 --- [main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthIndicatorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicatorRegistry]: Factory method 'healthIndicatorRegistry' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.camunda.bpm.engine.spring.SpringProcessEngineServicesConfiguration': Unsatisfied dependency expressed through field 'processEngine'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.camunda.bpm.spring.boot.starter.CamundaBpmAutoConfiguration$ProcessEngineConfigurationImplDependingConfiguration': Unsatisfied dependency expressed through field 'processEngineConfigurationImpl'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#org.springframework.beans.factory.annotation.Autowired(required=true)}
INFO 227891 --- [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
WARN 227891 --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
INFO 227891 --- [main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-06 10:21:45.754 ERROR 227891 --- [main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field processEngineConfigurationImpl in org.camunda.bpm.spring.boot.starter.CamundaBpmAutoConfiguration$ProcessEngineConfigurationImplDependingConfiguration required a bean of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' that could not be found.
The following candidates were found but could not be injected:
- Bean method 'processEngineConfigurationImpl' in 'CamundaBpmConfiguration' not loaded because #ConditionalOnMissingBean (types: org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; SearchStrategy: all) found beans of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' processEngineConfiguration
Action:
Consider revisiting the entries above or defining a bean of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' in your configuration.
What should I add / change in configs to make my "gradle" service work like "maven" one?
Surprisingly there's key difference in the way that two given projects retrieving connection and data source details.
For instance it's enough for me to put this into maven project properties to point camunda engine to my db (rest left "as-is"):
spring.datasource.url=${POSTGRES_ADDRESS:jdbc:postgresql://localhost:5432/myservice}
spring.datasource.username=${POSTGRES_USER:postgres}
spring.datasource.password=${POSTGRES_PASSWORD:12345}
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
while same config just doesn't work for gradle completely, obscurely complaining about processEngineConfigurationImpl bean absence when all what engine needs is database connection details.
So that's what I figured:
#Configuration
#ImportResource({"classpath:config.xml"})
public class Config {
#Value("${spring.datasource.url}")
private String url;
#Value("${spring.datasource.username}")
private String username;
#Value("${spring.datasource.password}")
private String password;
#Bean
public DataSource dataSource() {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName("org.postgresql.Driver");
dataSource.setUrl(url);
dataSource.setUsername(username);
dataSource.setPassword(password);
return dataSource;
}
#Bean
public PlatformTransactionManager transactionManager() {
return new DataSourceTransactionManager(dataSource());
}
#Bean
public ProcessEngineConfigurationImpl processEngineConfiguration() throws IOException {
SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
config.setDataSource(dataSource());
config.setTransactionManager(transactionManager());
config.setDatabaseSchemaUpdate("true");
config.setJobExecutorActivate(true);
config.setAuthorizationEnabled(true);
config.setDefaultSerializationFormat("application/json");
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
config.setDeploymentResources(resolver.getResources("classpath:/bpmn/*.bpmn"));
List<ProcessEnginePlugin> processEnginePlugins = new ArrayList<>();
config.setProcessEnginePlugins(processEnginePlugins);
return config;
}
}
And it works:
Spring-Boot: (v2.1.3.RELEASE)
Camunda BPM: (v7.13.0)
Camunda BPM Spring Boot Starter: (v7.13.0)
INFO 378753 --- [main] com.myname.myservice.Application : Starting Application on pc with PID 378753 (/home/user/IdeaProjects/myservice/build/classes/java/main started by user in /home/user/IdeaProjects/myservice)
INFO 378753 --- [main] com.myname.myservice.Application : No active profile set, falling back to default profiles: default
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7ms. Found 0 repository interfaces.
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7ms. Found 0 repository interfaces.
INFO 378753 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.kafka.annotation.KafkaBootstrapConfiguration' of type [org.springframework.kafka.annotation.KafkaBootstrapConfiguration$$EnhancerBySpringCGLIB$$f04798b1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 378753 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$1c95872e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 378753 --- [main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 5.2.4 by Boxfuse
INFO 378753 --- [main] o.f.c.internal.database.DatabaseFactory : Database: jdbc:postgresql://localhost:5432/myservice (PostgreSQL 12.1)
WARN 378753 --- [main] o.f.c.internal.database.base.Database : Flyway upgrade recommended: PostgreSQL 12.1 is newer than this version of Flyway and support has not been tested.
INFO 378753 --- [main] o.f.core.internal.command.DbValidate : Successfully validated 2 migrations (execution time 00:00.010s)
INFO 378753 --- [main] o.f.core.internal.command.DbMigrate : Current version of schema "public": 1
INFO 378753 --- [main] o.f.core.internal.command.DbMigrate : Schema "public" is up to date. No migration necessary.
INFO 378753 --- [main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
INFO 378753 --- [main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.7.Final}
INFO 378753 --- [main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
INFO 378753 --- [main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
INFO 378753 --- [main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect
INFO 378753 --- [main] o.h.e.j.e.i.LobCreatorBuilderImpl : HHH000422: Disabling contextual LOB creation as connection was null
INFO 378753 --- [main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType#642c6461
INFO 378753 --- [main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
INFO 378753 --- [main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper#a047bdb)), function-provider: org.camunda.bpm.dmn.feel.impl.scala.function.CustomFunctionTransformer#173b1af1, configuration: Configuration(false)]
INFO 378753 --- [main] org.camunda.bpm.engine : ENGINE-00001 Process Engine default created.
INFO 378753 --- [main] org.camunda.bpm.engine.jobexecutor : ENGINE-14014 Starting up the JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor].
INFO 378753 --- [ultJobExecutor]] org.camunda.bpm.engine.jobexecutor : ENGINE-14018 JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor] starting to acquire jobs
INFO 378753 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'asyncExecutor'
INFO 378753 --- [main] i.micrometer.influx.InfluxMeterRegistry : publishing metrics to influx every 1m
INFO 378753 --- [main] org.camunda.bpm.spring.boot : STARTER-SB040 Setting up jobExecutor with corePoolSize=3, maxPoolSize:10
INFO 378753 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'camundaTaskExecutor'
INFO 378753 --- [main] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 'taskScheduler'
INFO 378753 --- [main] n.d.b.g.s.s.GrpcServerLifecycle : gRPC Server started, listening on address: *, port: 8081
INFO 378753 --- [main] org.camunda.bpm.container : ENGINE-08024 Found processes.xml file at file:/home/user/IdeaProjects/myservice/build/resources/main/META-INF/processes.xml
INFO 378753 --- [main] org.camunda.bpm.container : ENGINE-08023 Deployment summary for process archive 'application':
As a sidenote - for unknown reason sql dialect is very important for bpm so this one is mandatory to set like this:
spring.jpa.database-platform = org.hibernate.dialect.PostgreSQL95Dialect
and not to forget to please flyway if used:
spring.flyway.baseline-on-migrate = true

Spring Boot with spring-boot-maven plug-in - unable to RESTART the application server after running integration tests

I have a Spring Boot application and that application has integration tests.
Here is the relevant snippet from my pom.xml for running the integration tests.
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.xyz.Application</mainClass>
<executable>true</executable>
<fork>true</fork>
<jmxPort>7654</jmxPort>
</configuration>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
<configuration>
<fork>true</fork>
<jmxPort>7654</jmxPort>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<fork>true</fork>
<jmxPort>7654</jmxPort>
</configuration>
</execution>
</executions>
</plugin>
When I run mvn verify, I see the unit tests running first. Then the application server starts and the integration tests run successfully. The mvn process exits with a success.
I also see the following in the console log which leads me to believe that the application server is being shutdown correctly -
[INFO] --- spring-boot-maven-plugin:2.1.1.RELEASE:stop (post-integration-test) # application ---
[DEBUG] Configuring mojo org.springframework.boot:spring-boot-maven-plugin:2.1.1.RELEASE:stop from plugin realm ClassRealm[plugin>org.springframework.boot:spring-boot-maven-plugin:2.1.1.RELEASE, parent: sun.misc.Launcher$AppClassLoader#42a57993]
[DEBUG] Configuring mojo 'org.springframework.boot:spring-boot-maven-plugin:2.1.1.RELEASE:stop' with basic configurator -->
[DEBUG] (f) fork = true
[DEBUG] (f) jmxPort = 7654
[DEBUG] (f) project = MavenProject: com.xyz:application:1.0-SNAPSHOT # /Users/me/code/my-project/pom.xml
[DEBUG] (f) skip = false
[DEBUG] -- end configuration --
[INFO] Stopping application...
2019-01-07 14:18:18.375 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] inMXBeanRegistrar$SpringApplicationAdmin : Application shutdown requested.
2019-01-07 14:18:18.375 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#449465bf: startup date [Mon Jan 07 14:17:22 EST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#475a6eb6
2019-01-07 14:18:18.376 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#4cf0901e: startup date [Mon Jan 07 14:17:30 EST 2019]; parent: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#449465bf
2019-01-07 14:18:18.385 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] o.e.jetty.server.AbstractConnector : Stopped ServerConnector#e45db77{HTTP/1.1,[http/1.1]}{0.0.0.0:8081}
2019-01-07 14:18:18.385 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] org.eclipse.jetty.server.session : node0 Stopped scavenging
2019-01-07 14:18:18.387 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] o.e.j.s.h.ContextHandler.application : Destroying Spring FrameworkServlet 'dispatcherServlet'
2019-01-07 14:18:18.388 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] o.e.jetty.server.handler.ContextHandler : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext#16b7a081{application,/,[file:///private/var/folders/sc/d2x30b2j6jj5hpvfkqx9p31n5jmbmc/T/jetty-docbase.6078950105283659171.8081/, jar:file:/Users/me/.m2/repository/io/springfox/springfox-swagger-ui/2.9.2/springfox-swagger-ui-2.9.2.jar!/META-INF/resources],UNAVAILABLE}
2019-01-07 14:18:18.390 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483647
2019-01-07 14:18:18.393 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2019-01-07 14:18:18.393 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans
2019-01-07 14:18:18.403 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] s.c.a.AnnotationConfigApplicationContext : Closing FeignContext-cse-service: startup date [Mon Jan 07 14:17:27 EST 2019]; parent: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#449465bf
...
2019-01-07 14:18:18.472 WARN [-,,,] 38653 --- [pool-1-thread-5] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2019-01-07 14:18:18.472 INFO [-,,,] 38653 --- [pool-1-thread-5] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2019-01-07 14:18:18.473 INFO [-,,,] 38653 --- [pool-1-thread-5] c.netflix.config.DynamicPropertyFactory : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration#139bf1b8
...
2019-01-07 14:18:18.628 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] o.e.jetty.server.AbstractConnector : Stopped ServerConnector#678b05be{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2019-01-07 14:18:18.628 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] org.eclipse.jetty.server.session : node0 Stopped scavenging
2019-01-07 14:18:18.629 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] o.e.j.s.h.ContextHandler.application : Destroying Spring FrameworkServlet 'dispatcherServlet'
2019-01-07 14:18:18.629 INFO [-,,,] 38653 --- [on(4)-127.0.0.1] o.e.jetty.server.handler.ContextHandler : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext#4808c18e{application,/api/v1,[file:///private/var/folders/sc/d2x30b2j6jj5hpvfkqx9p31n5jmbmc/T/jetty-docbase.6019952027552218513.8080/, jar:file:/Users/me/.m2/repository/io/springfox/springfox-swagger-ui/2.9.2/springfox-swagger-ui-2.9.2.jar!/META-INF/resources],UNAVAILABLE}
Subsequently, when I run mvn verify again, I get the following bind exception.
[DEBUG] Application argument(s):
[DEBUG] Connecting to local MBeanServer at port 7654
[DEBUG] Waiting for spring application to start...
[DEBUG] Connected to local MBeanServer at port 7654
[DEBUG] Waiting for spring application to start...
[DEBUG] Spring application is not ready yet, waiting 500ms (attempt 1)
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 7654; nested exception is:
java.net.BindException: Address already in use (Bind failed)
Using netstat and ps I am able to ascertain that there is some process that is still holding on to port 7654, and jps tells me that it is this process -
47148 Application -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=7654 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1
I don't know how to get the JMX process to shutdown. I assumed that the spring-boot-maven plug-in would do that. And that does not seem to be the case.
What am I doing wrong and can someone please help? Really appreciate you taking time to look at this (potential) problem.
I was facing the same issue, not being able to rerun tests before killing the JMX process. Next to that, my Azure DevOps pipeline was hanging because of the JMX process not being stopped.
The STDIO streams did not close within 10 seconds of the exit event from process '/usr/share/apache-maven-3.6.3/bin/mvn'. This may indicate a child process inherited the STDIO streams and has not yet exited.
When I browsed through the source code: https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java#L128, I discovered that the JMX agent would not be booted if I did not fork the maven process.
I'm not sure this is applicable for you, but I did not require forking per se, and also did not need JMX metrics, so this fixed it for me:
<configuration>
<fork>false</fork>
</configuration>
I also tried to override the jmx arguments (-Dcom.sun.management.jmxremote), by specifying them in the plugin configuration, but since the arguments are added (hardcoded) as the final arguments, that was not working for me.

What is the Jhipster registry url after deploying it on tomcat?

I want to deploy jhipster registry war on tomcat, deployment is successful but I am unable to access the url. I tried http://localhost:8080/jhipster-registry-2.5.8/ and http://localhost:8761/#/ neither worked. I know that default port for registry is 8761, Does Tomcat overwrites it?
2017-02-23 10:19:05.782 INFO 89248 --- [ost-startStop-1] i.g.jhipster.registry.ApplicationWebXml : The following profiles are active: prod
2017-02-23 10:19:08.230 WARN 89248 --- [ost-startStop-1] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance #Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static #Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider decl
2017-02-23 10:19:09.221 DEBUG 89248 --- [ost-startStop-1] i.g.j.r.config.MetricsConfiguration : Registering JVM gauges
2017-02-23 10:19:09.258 DEBUG 89248 --- [ost-startStop-1] i.g.j.r.config.MetricsConfiguration : Initializing Metrics JMX reporting
2017-02-23 10:19:12.162 INFO 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Web application configuration, using profiles: [prod]
2017-02-23 10:19:12.176 DEBUG 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Initializing Metrics registries
2017-02-23 10:19:12.188 DEBUG 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Registering Metrics Filter
2017-02-23 10:19:12.190 DEBUG 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Registering Metrics Servlet
2017-02-23 10:19:12.198 DEBUG 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Registering Caching HTTP Headers Filter
2017-02-23 10:19:12.200 INFO 89248 --- [ost-startStop-1] i.g.j.registry.config.WebConfigurer : Web application fully configured
2017-02-23 10:19:12.227 INFO 89248 --- [ost-startStop-1] i.g.jhipster.registry.JHipsterRegistry : Running with Spring profile(s) : [prod]
2017-02-23 10:19:15.853 INFO 89248 --- [ost-startStop-1] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data.
2017-02-23 10:19:15.883 INFO 89248 --- [ost-startStop-1] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1487863155883 with initial instances count: 0
2017-02-23 10:19:16.072 INFO 89248 --- [ost-startStop-1] c.n.eureka.DefaultEurekaServerContext : Initializing ...
2017-02-23 10:19:16.075 INFO 89248 --- [ost-startStop-1] c.n.eureka.cluster.PeerEurekaNodes : Adding new peer nodes [http://localhost:8761/eureka/]
2017-02-23 10:19:16.313 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2017-02-23 10:19:16.321 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2017-02-23 10:19:16.321 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2017-02-23 10:19:16.322 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2017-02-23 10:19:16.802 INFO 89248 --- [ost-startStop-1] c.n.eureka.cluster.PeerEurekaNodes : Replica node URL: http://localhost:8761/eureka/
2017-02-23 10:19:16.836 INFO 89248 --- [ost-startStop-1] c.n.e.registry.AbstractInstanceRegistry : Finished initializing remote region registries. All known remote regions: []
2017-02-23 10:19:16.838 INFO 89248 --- [ost-startStop-1] c.n.eureka.DefaultEurekaServerContext : Initialized
2017-02-23 10:19:21.092 WARN 89248 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2017-02-23 10:19:21.097 INFO 89248 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2017-02-23 10:19:21.116 WARN 89248 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2017-02-23 10:19:21.117 INFO 89248 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2017-02-23 10:19:23.779 INFO 89248 --- [ Thread-13] c.n.e.r.PeerAwareInstanceRegistryImpl : Got 1 instances from neighboring DS node
2017-02-23 10:19:23.794 INFO 89248 --- [ Thread-13] c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 1
2017-02-23 10:19:23.801 INFO 89248 --- [ Thread-13] c.n.e.r.PeerAwareInstanceRegistryImpl : Changing status to UP
2017-02-23 10:19:23.854 INFO 89248 --- [ost-startStop-1] i.g.jhipster.registry.ApplicationWebXml : Started ApplicationWebXml in 21.486 seconds (JVM running for 40.931)
2017-02-23 10:19:23.938 INFO 89248 --- [ost-startStop-1] c.s.j.s.i.a.WebApplicationImpl : Initiating Jersey application, version 'Jersey: 1.19.1 03/11/2016 02:08 PM'
2017-02-23 10:19:24.045 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2017-02-23 10:19:24.052 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2017-02-23 10:19:24.052 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2017-02-23 10:19:24.053 INFO 89248 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
23-Feb-2017 10:19:25.047 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive C:\apache-tomcat-8.0.39\webapps\jhipster-registry-2.5.war has finished in 36,797 ms
23-Feb-2017 10:19:25.060 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\apache-tomcat-8.0.39\webapps\docs
23-Feb-2017 10:19:25.110 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\apache-tomcat-8.0.39\webapps\docs has finished in 50 ms
23-Feb-2017 10:19:25.111 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\apache-tomcat-8.0.39\webapps\examples
23-Feb-2017 10:19:25.530 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\apache-tomcat-8.0.39\webapps\examples has finished in 419 ms
23-Feb-2017 10:19:25.530 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\apache-tomcat-8.0.39\webapps\host-manager
23-Feb-2017 10:19:25.578 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\apache-tomcat-8.0.39\webapps\host-manager has finished in 48 ms
23-Feb-2017 10:19:25.580 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\apache-tomcat-8.0.39\webapps\manager
23-Feb-2017 10:19:25.606 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\apache-tomcat-8.0.39\webapps\manager has finished in 27 ms
23-Feb-2017 10:19:25.607 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\apache-tomcat-8.0.39\webapps\ROOT
23-Feb-2017 10:19:25.636 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\apache-tomcat-8.0.39\webapps\ROOT has finished in 28 ms
23-Feb-2017 10:19:25.644 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"]
23-Feb-2017 10:19:25.663 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"]
23-Feb-2017 10:19:25.666 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 41071 ms
2017-02-23 10:20:22.433 DEBUG 89248 --- [apr-8080-exec-9] i.g.j.r.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2017-02-23 10:20:23.804 INFO 89248 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2017-02-23 10:21:23.804 INFO 89248 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 1ms
I reproduced your setup and got same problems.
Weird thing is that running
curl http://admin:admin#localhost:8080/jhipster-registry-2.5.8/
works fine: I get the home page contents.
So something does not work in the browser.
Using another port than 8761 and a context path different than / (in your case /jhipster-registry-2.5.8/) means that you must modify several application properties in registry's application*.yml and also the bootstrap.yml files from all your services and gateways registering with this registry.
To avoid this, I changed tomcat's port to 8761 and renamed the registry war file to ROOT.war but it still does not work.
To make it work would require some significant effort in debugging. So, I highly recommend that you stick to the recommended usage: either using java -jar jhipster-registry.war or using docker.

Categories

Resources