Created directory Product_dir
mkdir Product_dir
cd Product_dir
docker-compose up
Iam pointing data directory to path on my host machine : /var/elasticsearch/data/product1/
Gave full permission on directory: chmod -R 777 /var/elasticsearch/
changed owner to elasticsearch : chown -R elasticsearch:elasticsearch /var/elasticsearch/
docker-compose.yml file
version: "2"
services:
elasticsearch-5-6:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.3
container_name: elasticsearch-5-6
ports:
- "9201:9200"
volumes:
- /var/elasticsearch/data/product1/:/usr/share/elasticsearc/data/
#- /etc/elasticsearch/elasticsearch-5-6.yml:/usr/share/elasticsearch/config/elasticsearch.yml
#- /etc/elasticsearch/logging.yml:/usr/share/elasticsearch/config/logging.yml
#- /var/log/elasticsearch/:/usr/share/elasticsearch/logs/
environment:
- cluster.name=docker-cluster-elasticsearch-5-6
#- bootstrap.memory_lock=true
- "ES_JAVA_OPTS: -Xmx2048m -Xms2048m"
Log file:
[root#localhost docker-elasticsearch-5-6]# docker-compose up
Starting elasticsearch-5-6 ...
Starting elasticsearch-5-6 ... done
Attaching to elasticsearch-5-6
elasticsearch-5-6 | [2017-11-17T01:55:09,017][INFO ][o.e.n.Node ] [] initializing ...
elasticsearch-5-6 | [2017-11-17T01:55:09,035][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
elasticsearch-5-6 | org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to create node environment
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | Caused by: java.lang.IllegalStateException: Failed to create node environment
elasticsearch-5-6 | at org.elasticsearch.node.Node.<init>(Node.java:268) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.node.Node.<init>(Node.java:245) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | ... 6 more
elasticsearch-5-6 | Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes
elasticsearch-5-6 | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?]
elasticsearch-5-6 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?]
elasticsearch-5-6 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?]
elasticsearch-5-6 | at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:?]
elasticsearch-5-6 | at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_141]
elasticsearch-5-6 | at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_141]
elasticsearch-5-6 | at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_141]
elasticsearch-5-6 | at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:221) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.node.Node.<init>(Node.java:265) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.node.Node.<init>(Node.java:245) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:233) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.3.jar:5.6.3]
elasticsearch-5-6 | ... 6 more
elasticsearch-5-6 exited with code 1
Related
I am trying to use elasticsearch as a db for my application by using kafka connect in between. KafkaConnect, elasticsearch(version 7) and my application are running in a containers in a same network. When I trie to access elasticsearch from the container for kafkaconnect, it is successful. But my connector keeps throwing me the following error and I can't seem to figure out the exact issue:
Error:
container_standalone | java.lang.IllegalArgumentException: Invalid HTTP host: elasticsearch:9200/
container_standalone | at org.apache.http.HttpHost.create(HttpHost.java:123)
container_standalone | at io.confluent.connect.elasticsearch.jest.JestElasticsearchClient.lambda$getClientConfig$0(JestElasticsearchClient.java:201)
container_standalone | at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
container_standalone | at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
container_standalone | at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
container_standalone | at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
container_standalone | at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
container_standalone | at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
container_standalone | at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
container_standalone | at io.confluent.connect.elasticsearch.jest.JestElasticsearchClient.getClientConfig(JestElasticsearchClient.java:201)
container_standalone | at io.confluent.connect.elasticsearch.jest.JestElasticsearchClient.<init>(JestElasticsearchClient.java:149)
container_standalone | at io.confluent.connect.elasticsearch.jest.JestElasticsearchClient.<init>(JestElasticsearchClient.java:142)
container_standalone | at io.confluent.connect.elasticsearch.ElasticsearchSinkTask.start(ElasticsearchSinkTask.java:122)
container_standalone | at io.confluent.connect.elasticsearch.ElasticsearchSinkTask.start(ElasticsearchSinkTask.java:51)
container_standalone | at org.apache.kafka.connect.runtime.WorkerSinkTask.initializeAndStart(WorkerSinkTask.java:300)
container_standalone | at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:189)
container_standalone | at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:177)
container_standalone | at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:227)
container_standalone | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
container_standalone | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
container_standalone | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
container_standalone | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
container_standalone | at java.lang.Thread.run(Thread.java:748)
container_standalone | [2020-09-23 09:47:09,366] ERROR WorkerSinkTask{id=elasticsearch-sink-0} Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:180)
Configuration File:
name=elasticsearch-sink
connector.class=io.confluent.connect.elasticsearch.ElasticsearchSinkConnector
tasks.max=1
topics=vehicle
topic.index=test-vehicle
connection.url=http://elasticsearch:9200
connection.username=username
connection.password=password
type.name=log
key.ignore=true
schema.ignore=true
Elastic.yml file:
cluster.name: "docker-cluster"
network.host: 0.0.0.0
xpack.license.self_generated.type: trial
xpack.security.enabled: false
xpack.monitoring.collection.enabled: true
Starting our Server, we always get an exception starting with:
WARN [localhost-startStop-5] [TenantIgnoreXmlWebApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
This only happens on our Testsystem, but everything is fine in the local VM. The beans mentioned are part of hybris (I checked them, but they seem fine and I didn't touch anything and like I said it's working local) and the AddOn should be installed properly
<antcall target="addoninstall">
<param name="addonnames" value="cmsoccaddon"/>
<param name="addonStorefront.ycommercewebservices" value="ycommercewebservices"/>
</antcall>
Stacktrace:
INFO | jvm 1 | main | 2020/05/26 19:17:20.392 | INFO [localhost-startStop-4] [PropertySourcedRequestMappingHandlerMapping] Mapped URL path [/api-docs] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
INFO | jvm 1 | main | 2020/05/26 19:17:20.392 | WARN [localhost-startStop-5] [TenantIgnoreXmlWebApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
INFO | jvm 1 | main | 2020/05/26 19:17:20.392 | INFO [localhost-startStop-5] [TenantAwareEhCacheManagerFactoryBean] Shutting down EhCache CacheManager 'wsCache_master'
INFO | jvm 1 | main | 2020/05/26 19:17:20.492 | ERROR [localhost-startStop-5] [ContextLoader] Context initialization failed
INFO | jvm 1 | main | 2020/05/26 19:17:20.492 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
INFO | jvm 1 | main | 2020/05/26 19:17:20.492 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.492 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.492 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:399) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:159) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:828) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401) ~[spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292) [spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at de.hybris.platform.spring.HybrisContextLoaderListener.doInitWebApplicationContext(HybrisContextLoaderListener.java:226) [coreserver.jar:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at de.hybris.platform.spring.HybrisContextLoaderListener.initWebApplicationContext(HybrisContextLoaderListener.java:199) [coreserver.jar:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) [spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.493 | at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitialized(HybrisContextLoaderListener.java:95) [coreserver.jar:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.494 | at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699) [catalina.jar:8.5.51]
INFO | jvm 1 | main | 2020/05/26 19:17:20.494 | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165) [catalina.jar:8.5.51]
INFO | jvm 1 | main | 2020/05/26 19:17:20.494 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:8.5.51]
INFO | jvm 1 | main | 2020/05/26 19:17:20.494 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412) [catalina.jar:8.5.51]
INFO | jvm 1 | main | 2020/05/26 19:17:20.494 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402) [catalina.jar:8.5.51]
INFO | jvm 1 | main | 2020/05/26 19:17:20.494 | at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.494 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.494 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | at java.lang.Thread.run(Thread.java:834) [?:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.495 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | ... 29 more
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.496 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | ... 29 more
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | Caused by: java.lang.IllegalStateException: Singleton instance not initialized yet
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.util.Assert.state(Assert.java:73) ~[spring-core-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.beans.factory.config.AbstractFactoryBean.getSingletonInstance(AbstractFactoryBean.java:188) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.beans.factory.config.AbstractFactoryBean.access$200(AbstractFactoryBean.java:63) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.beans.factory.config.AbstractFactoryBean$EarlySingletonInvocationHandler.invoke(AbstractFactoryBean.java:275) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at com.sun.proxy.$Proxy272.forEach(Unknown Source) ~[?:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at de.hybris.platform.cmsoccaddon.mapping.DefaultCMSDataMapper.configure(DefaultCMSDataMapper.java:43) ~[cmsoccaddonserver.jar:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at ma.glasnost.orika.impl.ConfigurableMapper.init(ConfigurableMapper.java:119) ~[orika-core-1.5.2.jar:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at de.hybris.platform.webservicescommons.mapping.impl.DefaultDataMapper.setApplicationContext(DefaultDataMapper.java:74) ~[webservicescommonsserver.jar:?]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:120) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:96) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1763) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.497 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.498 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.498 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.498 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.498 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | ... 29 more
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | Mai 26, 2020 7:17:20 NACHM. org.apache.catalina.core.StandardContext listenerStart
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | SCHWERWIEGEND: Fehler beim Senden der 'Context Initialized' Benachrichtigung an den Listener aus der Klasse [de.hybris.platform.spring.HybrisContextLoaderListener]
INFO | jvm 1 | main | 2020/05/26 19:17:20.499 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
INFO | jvm 1 | main | 2020/05/26 19:17:20.500 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314)
INFO | jvm 1 | main | 2020/05/26 19:17:20.500 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
INFO | jvm 1 | main | 2020/05/26 19:17:20.500 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:399)
INFO | jvm 1 | main | 2020/05/26 19:17:20.500 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:159)
INFO | jvm 1 | main | 2020/05/26 19:17:20.500 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674)
INFO | jvm 1 | main | 2020/05/26 19:17:20.500 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426)
INFO | jvm 1 | main | 2020/05/26 19:17:20.500 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
INFO | jvm 1 | main | 2020/05/26 19:17:20.500 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
INFO | jvm 1 | main | 2020/05/26 19:17:20.500 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
INFO | jvm 1 | main | 2020/05/26 19:17:20.500 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
After that the server keeps booting and the most things seem to work, but not everthing, like caching
On got installed properly, the above exception comes when having the issue with addon installation.
Please Verify on the test server, your addon is installed properly on the given storefront.
to verify the addon please this property is injected in your addon or not.
XXXstorefront.additionalWebSpringConfigs.XXXsocialwebaddon=classpath\:/XXXsocialwebaddon/web/spring/XXXsocialwebaddon-web-spring.xml
XXXstorefront.wro4jconfigscan.XXXsocialwebaddon=true
Later if you don't want to run ant target to install addon please add this property to local.properties or specific to storefront project.properties.
I'm learning docker. While deploying my application(Angular, SpringBoot, RabbitMQ, MySQL), I'm able to access UI, but services are getting failed due to connection error between services and MySQL and RabbitMq. But individually I'm able to access both MySql and RabbitMq through docker exec command also tables and queues are getting generating while docker-compose up. But while testing, its not working
docker-compose.yml
version: '3.1'
services:
rabbitmq:
image: rabbitmq:management
ports:
- 5672:5672
- 15672:15672
mysql:
image: mysql:8.0.17
ports:
- 3306:3306
environment:
MYSQL_DATABASE: stackroute
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: cmatches
MYSQL_PASSWORD: cmatches
user-app:
image: userservice
build: userservice/
ports:
- 9100:9100
depends_on:
- mysql
network_mode: "host"
fav-app:
image: favouriteservice
build: favouriteservice/
ports:
- 9200:9200
depends_on:
- mysql
- rabbitmq
network_mode: "host"
rec-app:
image: matchrecommendationservice
build: matchrecommendationservice/
ports:
- 9300:9300
depends_on:
- mysql
- rabbitmq
network_mode: "host"
cmatches-ui:
build: CMatchesUI/
container_name: cmatchesUi
ports:
- 4200:4200
Individual dockerfile is working fine.
Error:
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
Do I need to change something in application.properties
server.port=9200
spring.datasource.url=jdbc:mysql://localhost:3306/stackroute?verifyServerCertificate=false&useSSL=false&requireSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=password
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.hibernate.ddl-auto = update
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.cloud.stream.bindings.recommendedMatchesChannel.destination=recommendedMatches
spring.cloud.stream.default.contentType=application/json
=========================================================================
Updates:
1.
Tried changing
spring.datasource.url=jdbc:mysql://mysql:3306/stackroute?verifyServerCertificate=false&useSSL=false&requireSSL=false&allowPublicKeyRetrieval=true
Got following error :
Caused by: java.net.UnknownHostException: mysql
-Reverted-
2.
Removed network_mode: host
got following error
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
user-app_1 |
user-app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
user-app_1 | at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:827) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:447) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:136) ~[HikariCP-3.2.0.jar!/:na]
user-app_1 | at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369) ~[HikariCP-3.2.0.jar!/:na]
user-app_1 | at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198) ~[HikariCP-3.2.0.jar!/:na]
user-app_1 | at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467) [HikariCP-3.2.0.jar!/:na]
user-app_1 | at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541) [HikariCP-3.2.0.jar!/:na]
user-app_1 | at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) [HikariCP-3.2.0.jar!/:na]
user-app_1 | at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) [HikariCP-3.2.0.jar!/:na]
user-app_1 | at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:68) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:94) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:179) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:119) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:904) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:935) [hibernate-core-5.3.7.Final.jar!/:5.3.7.Final]
user-app_1 | at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) [spring-orm-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) [spring-orm-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390) [spring-orm-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377) [spring-orm-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) [spring-orm-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804) [spring-beans-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741) [spring-beans-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) [spring-beans-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) [spring-beans-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) [spring-beans-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) [spring-beans-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1083) ~[spring-context-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:853) ~[spring-context-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
user-app_1 | at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.2.RELEASE.jar!/:2.1.2.RELEASE]
user-app_1 | at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.1.2.RELEASE.jar!/:2.1.2.RELEASE]
user-app_1 | at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.1.2.RELEASE.jar!/:2.1.2.RELEASE]
user-app_1 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[spring-boot-2.1.2.RELEASE.jar!/:2.1.2.RELEASE]
user-app_1 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) ~[spring-boot-2.1.2.RELEASE.jar!/:2.1.2.RELEASE]
user-app_1 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) ~[spring-boot-2.1.2.RELEASE.jar!/:2.1.2.RELEASE]
user-app_1 | at com.stackroute.userservice.UserServiceApplication.main(UserServiceApplication.java:10) ~[classes!/:1.0]
user-app_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
user-app_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
user-app_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
user-app_1 | at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
user-app_1 | at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[userservice-1.0.jar:1.0]
user-app_1 | at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[userservice-1.0.jar:1.0]
user-app_1 | at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) ~[userservice-1.0.jar:1.0]
user-app_1 | at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) ~[userservice-1.0.jar:1.0]
user-app_1 | Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
user-app_1 |
user-app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
user-app_1 | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_111]
user-app_1 | at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_111]
user-app_1 | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_111]
user-app_1 | at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_111]
user-app_1 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:91) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.NativeSession.connect(NativeSession.java:150) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:947) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:817) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | ... 57 common frames omitted
user-app_1 | Caused by: java.net.ConnectException: Connection refused (Connection refused)
user-app_1 | at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_111]
user-app_1 | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_111]
user-app_1 | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_111]
user-app_1 | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_111]
user-app_1 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_111]
user-app_1 | at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_111]
user-app_1 | at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
user-app_1 | ... 60 common frames omitted
You can't use localhost as the host name since the applications are run in a docker container. Also, to communicate each other, all the containers should be in the same docker network;
version: '3.1'
services:
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
ports:
- 5672:5672
- 15672:15672
networks:
- my-net
mysql:
image: mysql:8.0.17
container_name: mysql
ports:
- 3306:3306
environment:
MYSQL_DATABASE: stackroute
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: cmatches
MYSQL_PASSWORD: cmatches
networks:
- my-net
user-app:
image: userservice
build: userservice/
container_name: userapp
ports:
- 9100:9100
depends_on:
- mysql
networks:
- my-net
fav-app:
image: favouriteservice
build: favouriteservice/
container_name: favapp
ports:
- 9200:9200
depends_on:
- mysql
- rabbitmq
networks:
- my-net
rec-app:
image: matchrecommendationservice
build: matchrecommendationservice/
container_name: recapp
ports:
- 9300:9300
depends_on:
- mysql
- rabbitmq
networks:
- my-net
cmatches-ui:
build: CMatchesUI/
container_name: cmatchesUi
ports:
- 4200:4200
networks:
- my-net
networks:
my-net:
Replace host name in all places to their respective container names like this;
server.port=9200
spring.datasource.url=jdbc:mysql://mysql:3306/stackroute?verifyServerCertificate=false&useSSL=false&requireSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=password
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.hibernate.ddl-auto = update
spring.rabbitmq.host=rabbitmq
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.cloud.stream.bindings.recommendedMatchesChannel.destination=recommendedMatches
spring.cloud.stream.default.contentType=application/json
I think this is because you use network_mode = host
This means that you would like to "reuse" the namespace from the underlying host network.
Try to use the default "bridge" mode so that docker will create a "virtual network" between the containers.
This bridge mode is the default one, so just remove the line network_mode: "host" from the docker compose file.
Here is one nice tutorial that descibes docker network support at the high level.
I am trying to containerize my Spring Boot app to work with multiple environments (production and dev). In my dev environment, I use docker-compose to start up an instance of MySQL server which my Spring Boot app is able to connect to when it is running outside a container but when my Spring Boot app is running in a container, it is unable to connect to the MySQL server.
This is the error I get when I run docker-compose up.
app_1 | 19:48:07.708 ERROR -- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'sessionRepositoryFilterRegistration' defined in class path resource [org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.class]: Unsatisfied dependency expressed through method 'sessionRepositoryFilterRegistration' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.session.jdbc.config.annotation.web.http.JdbcHttpSessionConfiguration': Unsatisfied dependency expressed through method 'setTransactionManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException:
app_1 | Unable to obtain connection from database (jdbc:mysql://localhost:3306/app) for user 'root': Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
app_1 | SQL State : 08S01
app_1 | Error Code : 0
app_1 | Message : Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 |
app_1 | 19:48:07.736 INFO -- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
app_1 | 19:48:07.740 WARN -- [ 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
app_1 | 19:48:07.751 INFO -- [ main] ConditionEvaluationReportLoggingListener :
app_1 |
app_1 | Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
app_1 | 19:48:07.757 ERROR -- [ main] o.s.boot.SpringApplication : Application run failed
app_1 |
app_1 | org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
app_1 | at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:157)
app_1 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
app_1 | at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
app_1 | at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
app_1 | at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
app_1 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
app_1 | at com.brand.app.AppApp.main(AppApp.java:28)
app_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
app_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
app_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
app_1 | at java.lang.reflect.Method.invoke(Method.java:498)
app_1 | at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
app_1 | at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
app_1 | at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
app_1 | at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
app_1 | Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
app_1 | at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:125)
app_1 | at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86)
app_1 | at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:427)
app_1 | at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:180)
app_1 | at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:181)
app_1 | at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:154)
app_1 | ... 14 common frames omitted
app_1 | Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sessionRepositoryFilterRegistration' defined in class path resource [org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.class]: Unsatisfied dependency expressed through method 'sessionRepositoryFilterRegistration' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.session.jdbc.config.annotation.web.http.JdbcHttpSessionConfiguration': Unsatisfied dependency expressed through method 'setTransactionManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException:
app_1 | Unable to obtain connection from database (jdbc:mysql://localhost:3306/app) for user 'root': Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
app_1 | SQL State : 08S01
app_1 | Error Code : 0
app_1 | Message : Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 |
app_1 | at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769)
app_1 | at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:509)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
app_1 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
app_1 | at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:235)
app_1 | at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:226)
app_1 | at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:101)
app_1 | at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:88)
app_1 | at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:261)
app_1 | at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:234)
app_1 | at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:54)
app_1 | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5139)
app_1 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
app_1 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1377)
app_1 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1367)
app_1 | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
app_1 | at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
app_1 | at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
app_1 | at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:902)
app_1 | at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831)
app_1 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
app_1 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1377)
app_1 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1367)
app_1 | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
app_1 | at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
app_1 | at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
app_1 | at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:902)
app_1 | at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
app_1 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
app_1 | at org.apache.catalina.core.StandardService.startInternal(StandardService.java:423)
app_1 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
app_1 | at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:928)
app_1 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
app_1 | at org.apache.catalina.startup.Tomcat.start(Tomcat.java:455)
app_1 | at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:106)
app_1 | ... 19 common frames omitted
app_1 | Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.session.jdbc.config.annotation.web.http.JdbcHttpSessionConfiguration': Unsatisfied dependency expressed through method 'setTransactionManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException:
app_1 | Unable to obtain connection from database (jdbc:mysql://localhost:3306/app) for user 'root': Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
app_1 | SQL State : 08S01
app_1 | Error Code : 0
app_1 | Message : Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 |
app_1 | at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:676)
app_1 | at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
app_1 | at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
app_1 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
app_1 | at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:392)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
app_1 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
app_1 | at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
app_1 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1247)
app_1 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1167)
app_1 | at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857)
app_1 | at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760)
app_1 | ... 59 common frames omitted
app_1 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException:
app_1 | Unable to obtain connection from database (jdbc:mysql://localhost:3306/app) for user 'root': Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
app_1 | SQL State : 08S01
app_1 | Error Code : 0
app_1 | Message : Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 |
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
app_1 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
app_1 | at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
app_1 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1247)
app_1 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1167)
app_1 | at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:668)
app_1 | ... 82 common frames omitted
app_1 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException:
app_1 | Unable to obtain connection from database (jdbc:mysql://localhost:3306/app) for user 'root': Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
app_1 | SQL State : 08S01
app_1 | Error Code : 0
app_1 | Message : Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 |
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
app_1 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:307)
app_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:224)
app_1 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1115)
app_1 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:407)
app_1 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:341)
app_1 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:335)
app_1 | at org.springframework.orm.jpa.EntityManagerFactoryUtils.findEntityManagerFactory(EntityManagerFactoryUtils.java:120)
app_1 | at org.springframework.orm.jpa.JpaTransactionManager.setBeanFactory(JpaTransactionManager.java:313)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1800)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1765)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
app_1 | ... 91 common frames omitted
app_1 | Caused by: org.flywaydb.core.internal.exception.FlywaySqlException:
app_1 | Unable to obtain connection from database (jdbc:mysql://localhost:3306/app) for user 'root': Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
app_1 | SQL State : 08S01
app_1 | Error Code : 0
app_1 | Message : Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 |
app_1 | at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:60)
app_1 | at org.flywaydb.core.internal.database.DatabaseFactory.createDatabase(DatabaseFactory.java:72)
app_1 | at org.flywaydb.core.Flyway.execute(Flyway.java:1670)
app_1 | at org.flywaydb.core.Flyway.migrate(Flyway.java:1356)
app_1 | at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837)
app_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)
app_1 | ... 108 common frames omitted
app_1 | Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
app_1 |
app_1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
app_1 | at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
app_1 | at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
Here are some of the files involved.
docker-compose.yml - starts MySQL server and builds using a Dockerfile
Dockerfile - copies necessary files and runs entrypoint.sh
entrypoint.sh - starts the Spring Boot app jar
application.properties
application-dev.properties
docker-compose.yml
version: "3"
services:
app:
build:
context: ..
dockerfile: Dockerfile
args:
SPRING_PROFILES_ACTIVE: dev
image: app:dev
depends_on:
- mysql
mysql:
image: mysql:5.6
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: app
MYSQL_ROOT_PASSWORD: password
volumes:
- mysql_data:/var/lib/mysql/data
volumes:
mysql_data:
Dockerfile
FROM openjdk:8-jdk-alpine
ARG SPRING_PROFILES_ACTIVE=""
ENV SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE}
COPY target/app.jar /usr/share/
COPY script/entrypoint.sh /bin/entrypoint.sh
ENTRYPOINT /bin/entrypoint.sh
EXPOSE 5050
entrypoint.sh
#!/bin/sh
sleep 15
exec /usr/bin/java \
-jar /usr/share/app.jar \
--spring.profiles.active=${SPRING_PROFILES_ACTIVE}
Any idea why Spring Boot can't connect to MySQL server? Both containers should be on the same default network.
The Spring Boot app is trying to connect to jdbc:mysql://localhost:3306/app which is fine when the app isn't in a container but when it is in a container, localhost is not valid. The name of the MySQL server service is mysql (defined in the docker-compose.yml), so replacing localhost with mysql will resolve the issue.
For connecting from a docker service to another docker service like a database-service must be set local IP in docker-machine, in this state don't know docker service local IP, we can call with service name instead of service IP. so in the inner docker-machine network for connection to the mysql database or any database as docker service should be changed URL connection to docker service IP or service name
for example,
database URL connection
jdbc:mysql://your-mysql-service-name:3306/app
docker-compose declare service
version: '3.1'
services:
your-mysql-service-name:
container_name: your-mysql-service-name
image: mysql:5.6
restart: always
command: --default-authentication-plugin=mysql_native_password
deploy:
replicas: 1
ports:
- 3306:3306
environment:
MYSQL_DATABASE: "db_name"
MYSQL_ROOT_PASSWORD: "your-password"
i have installed sonar on rhel 6.3 64 bit machine but when trying to access the application through web using "http://10.217.14.40:13385/sonar" i get HTTP Error 503 Service Unavailable
Following is the last 100 lines from the log
[root#RHEL-6 logs]# tail -100 sonar.log
INFO | jvm 1 | 2012/09/25 07:58:21 | 07:58:21,136 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - ROOT level set to INFO
INFO | jvm 1 | 2012/09/25 07:58:21 | 07:58:21,136 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [SONAR_FILE] to Logger[ROOT]
INFO | jvm 1 | 2012/09/25 07:58:21 | 07:58:21,136 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#77435978 - Registering current configuration as safe fallback point
INFO | jvm 1 | 2012/09/25 07:58:21 |
2012.09.25 07:58:21 INFO o.s.s.p.ServerImpl Sonar Server / 3.2 / d9303b2d9d4c1e75f8536e4144028f1999f727f4
2012.09.25 07:58:21 INFO o.s.s.d.EmbeddedDatabase Starting embedded database on port 9092 with url jdbc:h2:tcp://10.217.14.40:13384/sonar
2012.09.25 07:58:21 ERROR o.s.s.p.Platform Unable to start database
org.sonar.api.utils.SonarException: Unable to start database
at org.sonar.server.database.EmbeddedDatabase.start(EmbeddedDatabase.java:75) ~[classes/:na]
at org.sonar.server.database.EmbeddedDatabaseFactory.start(EmbeddedDatabaseFactory.java:41) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_07]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_07]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_07]
at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_07]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.14.1.jar:na]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.14.1.jar:na]
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.14.1.jar:na]
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) ~[picocontainer-2.14.1.jar:na]
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) ~[picocontainer-2.14.1.jar:na]
at org.picocontainer.behaviors.Stored.start(Stored.java:110) ~[picocontainer-2.14.1.jar:na]
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1009) ~[picocontainer-2.14.1.jar:na]
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002) ~[picocontainer-2.14.1.jar:na]
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:760) ~[picocontainer-2.14.1.jar:na]
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:70) ~[sonar-plugin-api-3.2.jar:na]
at org.sonar.server.platform.Platform.startDatabaseConnectors(Platform.java:166) ~[classes/:na]
at org.sonar.server.platform.Platform.init(Platform.java:114) ~[classes/:na]
at org.sonar.server.platform.PlatformLifecycleListener.contextInitialized(PlatformLifecycleListener.java:33) [classes/:na]
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1272) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:489) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jetty-util-6.1.25.jar:6.1.25]
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.Server.doStart(Server.java:224) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jetty-util-6.1.25.jar:6.1.25]
at org.sonar.application.JettyEmbedder.start(JettyEmbedder.java:72) [sonar-application-3.2.jar:na]
at org.sonar.application.StartServer.main(StartServer.java:48) [sonar-application-3.2.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_07]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_07]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_07]
at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_07]
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) [wrapper-3.2.3.jar:3.2.3]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_07]
Caused by: org.h2.jdbc.JdbcSQLException: Exception opening port "9092" (port may be in use), cause: "java.net.BindException: Address already in use" [90061-167]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) ~[h2-1.3.167.jar:1.3.167]
at org.h2.message.DbException.get(DbException.java:158) ~[h2-1.3.167.jar:1.3.167]
at org.h2.util.NetUtils.createServerSocketTry(NetUtils.java:190) ~[h2-1.3.167.jar:1.3.167]
at org.h2.util.NetUtils.createServerSocket(NetUtils.java:156) ~[h2-1.3.167.jar:1.3.167]
at org.h2.server.TcpServer.start(TcpServer.java:222) ~[h2-1.3.167.jar:1.3.167]
at org.h2.tools.Server.start(Server.java:455) ~[h2-1.3.167.jar:1.3.167]
at org.sonar.server.database.EmbeddedDatabase.start(EmbeddedDatabase.java:71) ~[classes/:na]
... 35 common frames omitted
Caused by: java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method) ~[na:1.7.0_07]
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376) ~[na:1.7.0_07]
at java.net.ServerSocket.bind(ServerSocket.java:376) ~[na:1.7.0_07]
at java.net.ServerSocket.<init>(ServerSocket.java:237) ~[na:1.7.0_07]
at java.net.ServerSocket.<init>(ServerSocket.java:128) ~[na:1.7.0_07]
at org.h2.util.NetUtils.createServerSocketTry(NetUtils.java:186) ~[h2-1.3.167.jar:1.3.167]
... 39 common frames omitted
INFO | jvm 1 | 2012/09/25 07:58:21 | 2012-09-25 07:58:21.716:WARN::Failed startup of context org.mortbay.jetty.webapp.WebAppContext#1778db3{/,file:/home/BuildTools/sonar-3.2/war/sonar-server}
INFO | jvm 1 | 2012/09/25 07:58:21 | org.sonar.api.utils.SonarException: Unable to start database
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.sonar.server.database.EmbeddedDatabase.start(EmbeddedDatabase.java:75)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.sonar.server.database.EmbeddedDatabaseFactory.start(EmbeddedDatabaseFactory.java:41)
INFO | jvm 1 | 2012/09/25 07:58:21 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2012/09/25 07:58:21 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
INFO | jvm 1 | 2012/09/25 07:58:21 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 1 | 2012/09/25 07:58:21 | at java.lang.reflect.Method.invoke(Method.java:601)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.picocontainer.behaviors.Stored.start(Stored.java:110)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1009)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:760)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:70)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.sonar.server.platform.Platform.startDatabaseConnectors(Platform.java:166)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.sonar.server.platform.Platform.init(Platform.java:114)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.sonar.server.platform.PlatformLifecycleListener.contextInitialized(PlatformLifecycleListener.java:33)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1272)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:489)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.mortbay.jetty.Server.doStart(Server.java:224)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.sonar.application.JettyEmbedder.start(JettyEmbedder.java:72)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.sonar.application.StartServer.main(StartServer.java:48)
INFO | jvm 1 | 2012/09/25 07:58:21 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2012/09/25 07:58:21 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
INFO | jvm 1 | 2012/09/25 07:58:21 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 1 | 2012/09/25 07:58:21 | at java.lang.reflect.Method.invoke(Method.java:601)
INFO | jvm 1 | 2012/09/25 07:58:21 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
INFO | jvm 1 | 2012/09/25 07:58:21 | at java.lang.Thread.run(Thread.java:722)
INFO | jvm 1 | 2012/09/25 07:58:21 | 2012-09-25 07:58:21.737:INFO::Started SelectChannelConnector#10.217.14.40:13385
As you can read in your log, Sonar fails to start because H2 database cannot be started. It can't be started because the port 9092 is already used:
Exception opening port "9092" (port may be in use), cause: "java.net.BindException: Address already in use"
This means that you already have another process that uses this port - probably another Sonar instance that is already started...