i have the same config on application-dev.yml
and application-prod.yml
on dev ( with eclipse ) app run fine without any problem but in prod with these steps i got an error.
I have packaged my app with :
mvnw -Pprod -DskipTests clean verify -T 4
then i ran
java -jar XXX-0.0.1-SNAPSHOT.jar
i m getting this error:
:: JHipster ? :: Running Spring Boot 2.2.7.RELEASE ::
:: https://www.jhipster.tech ::
2021-01-09 07:55:19.273 INFO 3816 --- [ main] com.example.testApp : Starting testApp on DESKTOP-6LR145I with PID 3816 (C:\...\target\XXX-SNAPSHOT.jar started by Mahmoud in C:\...\target)
2021-01-09 07:55:19.280 INFO 3816 --- [ main] com.example.testApp : The following profiles are active: prod
2021-01-09 07:55:34.881 WARN 3816 --- [ main] c.h.instance.HazelcastInstanceFactory : Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance result
s. Arguments to be used: --add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio
=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.ma
nagement.internal=ALL-UNNAMED
2021-01-09 07:55:35.151 INFO 3816 --- [ main] com.hazelcast.instance.AddressPicker : [LOCAL] [dev] [3.12.7] Prefer IPv4 stack is true, prefer IPv6 addresses is false
2021-01-09 07:55:35.503 INFO 3816 --- [ main] com.hazelcast.instance.AddressPicker : [LOCAL] [dev] [3.12.7] Picked [192.168.1.110]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
2021-01-09 07:55:35.576 INFO 3816 --- [ main] com.hazelcast.system: [192.168.1.110]:5701 [dev] [3.12.7] Hazelcast 3.12.7 (20200430 - bf4b643) starting at [192.168.1.110]:5701
2021-01-09 07:55:35.578 INFO 3816 --- [ main] com.hazelcast.system : [192.168.1.110]:5701 [dev] [3.12.7] Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved.
2021-01-09 07:55:36.588 INFO 3816 --- [ main] c.h.s.i.o.impl.BackpressureRegulator : [192.168.1.110]:5701 [dev] [3.12.7] Backpressure is disabled
2021-01-09 07:55:38.617 INFO 3816 --- [ main] com.hazelcast.instance.Node : [192.168.1.110]:5701 [dev] [3.12.7] Creating MulticastJoiner
2021-01-09 07:55:39.216 INFO 3816 --- [ main] c.h.s.i.o.impl.OperationExecutorImpl : [192.168.1.110]:5701 [dev] [3.12.7] Starting 4 partition threads and 3 generic threads (1 dedicated for priority tasks)
2021-01-09 07:55:39.219 INFO 3816 --- [ main] c.h.internal.diagnostics.Diagnostics : [192.168.1.110]:5701 [dev] [3.12.7] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVMarguments.
2021-01-09 07:55:39.234 INFO 3816 --- [ main] com.hazelcast.core.LifecycleService : [192.168.1.110]:5701 [dev] [3.12.7] [192.168.1.110]:5701 is STARTING
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.hazelcast.internal.networking.nio.SelectorOptimizer (jar:file:/C:/.../target/XXX-SNAPSHOT.jar!/BOOT-INF/lib/hazelcast-3.12.7.jar!/) to field sun.nio.ch.SelectorImpl.selected
Keys
WARNING: Please consider reporting this to the maintainers of com.hazelcast.internal.networking.nio.SelectorOptimizer
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-01-09 07:55:41.283 INFO 3816 --- [ main] c.h.internal.cluster.ClusterService : [192.168.1.110]:5701 [dev] [3.12.7]
Members {size:1, ver:1} [
Member [192.168.1.110]:5701 - a143bb62-c166-4c2e-9161-9efb228a1222 this
]
2021-01-09 07:55:41.330 INFO 3816 --- [ main] com.hazelcast.core.LifecycleService : [192.168.1.110]:5701 [dev] [3.12.7] [192.168.1.110]:5701 is STARTED
2021-01-09 07:55:41.975 INFO 3816 --- [ main] com.example.config.WebConfigurer : Web application configuration, using profiles: prod
2021-01-09 07:55:41.984 INFO 3816 --- [ main] com.example.config.WebConfigurer : Web application fully configured
2021-01-09 08:00:53.036 WARN 3816 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.Bean
CreationException: Error creating bean with name 'liquibase' defined in class path resource [com.example/config/LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.LockException: Could not acquire change log lock. Currently locked by 192.168.0.12
(192.168.0.12) since 1/8/21, 11:27 PM
2021-01-09 08:00:53.708 INFO 3816 --- [ main] com.hazelcast.core.LifecycleService : [192.168.1.110]:5701 [dev] [3.12.7] [192.168.1.110]:5701 is SHUTTING_DOWN
2021-01-09 08:00:53.719 INFO 3816 --- [ main] com.hazelcast.instance.Node : [192.168.1.110]:5701 [dev] [3.12.7] Shutting down multicast service...
2021-01-09 08:00:53.721 INFO 3816 --- [ main] com.hazelcast.instance.Node : [192.168.1.110]:5701 [dev] [3.12.7] Shutting down connection manager...
2021-01-09 08:00:53.726 INFO 3816 --- [ main] com.hazelcast.instance.Node : [192.168.1.110]:5701 [dev] [3.12.7] Shutting down node engine...
2021-01-09 08:00:53.741 INFO 3816 --- [ main] com.hazelcast.instance.NodeExtension : [192.168.1.110]:5701 [dev] [3.12.7] Destroying node NodeExtension.
2021-01-09 08:00:53.742 INFO 3816 --- [ main] com.hazelcast.instance.Node : [192.168.1.110]:5701 [dev] [3.12.7] Hazelcast Shutdown is completed in 29 ms.
2021-01-09 08:00:53.828 INFO 3816 --- [ main] com.hazelcast.core.LifecycleService : [192.168.1.110]:5701 [dev] [3.12.7] [192.168.1.110]:5701 is SHUTDOWN
2021-01-09 08:00:53.829 INFO 3816 --- [ main] com.example.config.CacheConfiguration : Closing Cache Manager
2021-01-09 08:00:53.887 ERROR 3816 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [com.example/config/
LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.LockException: Could not acquire change log lock. Currently locked by 192.168.0.12 (192.168.0.12) since 1/8/21, 11:27 PM
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1108)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at com.example.testApp.main(testApp.java:63)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: liquibase.exception.LockException: Could not acquire change log lock. Currently locked by 192.168.0.12 (192.168.0.12) since 1/8/21, 11:27 PM
at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:236)
at liquibase.Liquibase.update(Liquibase.java:184)
at liquibase.Liquibase.update(Liquibase.java:179)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:366)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:314)
at org.springframework.boot.autoconfigure.liquibase.DataSourceClosingSpringLiquibase.afterPropertiesSet(DataSourceClosingSpringLiquibase.java:46)
at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.initDb(AsyncSpringLiquibase.java:118)
at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.afterPropertiesSet(AsyncSpringLiquibase.java:103)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
... 24 common frames omitted
I don't understand why prod profile causes this issue. If someone knows what's wrong here any solution for this ? what can i do to resolve this prob ?
DATABASECHANGELOGLOCK
table? Are you using the same db connection details for both dev and prod? – rcgeorge23 Jan 9 at 7:37