Spring Boot application failed to start on ECS Fargte - java

Ive got a springboot application that when bundled into a docker image and published to Amazon ECS fails to start
The error message is:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| timestamp | message |
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1645724032287 | . ____ _ __ _ _ |
| 1645724032287 | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ |
| 1645724032287 | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ |
| 1645724032287 | \\/ ___)| |_)| | | | | || (_| | ) ) ) ) |
| 1645724032287 | ' |____| .__|_| |_|_| |_\__, | / / / / |
| 1645724032287 | =========|_|==============|___/=/_/_/_/ |
| 1645724032290 | :: Spring Boot :: |
| 1645724033092 | 17:33:53.090 [main] INFO com.jtmaxwell.Microservice.DocumentGenerator.Application - Starting Application using Java 11.0.14.1 on ip-172-31-20-189.eu-west-1.compute.internal with PID 1 (/app.jar started by root in /) |
| 1645724033093 | 17:33:53.093 [main] DEBUG com.jtmaxwell.Microservice.DocumentGenerator.Application - Running with Spring Boot, Spring |
| 1645724033093 | 17:33:53.093 [main] INFO com.jtmaxwell.Microservice.DocumentGenerator.Application - No active profile set, falling back to default profiles: default |
| 1645724033095 | 17:33:53.095 [main] DEBUG org.springframework.boot.SpringApplication - Loading source class com.jtmaxwell.Microservice.DocumentGenerator.Application |
| 1645724033893 | 17:33:53.893 [main] DEBUG org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#13acb0d1 |
| 1645724034087 | 17:33:54.087 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' |
| 1645724034591 | 17:33:54.590 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/app.jar!/com/jtmaxwell/Microservice/DocumentGenerator/config/MessagingConfig.class] |
| 1645724034601 | 17:33:54.599 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/app.jar!/com/jtmaxwell/Microservice/DocumentGenerator/consumer/User.class] |
| 1645724034697 | 17:33:54.693 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/app.jar!/com/jtmaxwell/Microservice/DocumentGenerator/publisher/OrderPublisher.class] |
| 1645724035094 | 17:33:55.094 [main] ERROR org.springframework.boot.SpringApplication - Application run failed |
| 1645724035094 | java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring.factories. If you are using a custom packaging, make sure that file is correct. |
| 1645724035094 | at org.springframework.util.Assert.notEmpty(Assert.java:470) |
| 1645724035094 | at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.getCandidateConfigurations(AutoConfigurationImportSelector.java:180) |
| 1645724035094 | at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.getAutoConfigurationEntry(AutoConfigurationImportSelector.java:123) |
| 1645724035094 | at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector$AutoConfigurationGroup.process(AutoConfigurationImportSelector.java:434) |
| 1645724035094 | at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGrouping.getImports(ConfigurationClassParser.java:879) |
| 1645724035094 | at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:809) |
| 1645724035094 | at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:780) |
| 1645724035094 | at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:193) |
| 1645724035094 | at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) |
| 1645724035094 | at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) |
| 1645724035094 | at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) |
| 1645724035094 | at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) |
| 1645724035094 | at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) |
| 1645724035094 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) |
| 1645724035094 | at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) |
| 1645724035094 | at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) |
| 1645724035094 | at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) |
| 1645724035094 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) |
| 1645724035094 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) |
| 1645724035094 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) |
| 1645724035094 | at com.jtmaxwell.Microservice.DocumentGenerator.Application.main(Application.java:18) |
| 1645724035293 | 17:33:55.290 [main] DEBUG org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#13acb0d1, started on Thu Feb 24 17:33:53 UTC 2022 |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The pom.xml is
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.jtmaxwell</groupId>
<artifactId>microservice.documentgenerator</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Microservice.DocumentGenerator</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<repositories>
<repository>
<id>clojars.org</id>
<url>https://repo.clojars.org</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.github.erdos</groupId>
<artifactId>stencil-core</artifactId>
<version>0.3.29</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

Can you please check first the docker images run outside of ECS? Seem there are some libs not got bundled as part of the docker build.
Also i assume your spring boot app runs locally

The answer here was as others highlighted. The image was missing dependencies due to the jar file from Visual Code being used for the docker build.
I ran the supplied
mvnw package
Then used the resulting jar file to build the docker image

Related

Error java.net.UnknownHostException: pubsub.googleapis.com Name or service not know

Java client with code to publish messages to pubsub gcp topic. This code works fine in my localhost but when I try runnnig my jar on linux and with proxy this error is shown:
INFO | jvm 1 | 2022/10/25 12:28:38 | WARNING: [Channel<1>: (pubsub.googleapis.com:443)] Failed to resolve name. status=Status{code=UNAVAILABLE, description=Unable to resolve host pubsub.googleapis.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: pubsub.googleapis.com: Name or service not known
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:223)
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.internal.DnsNameResolver.doResolve(DnsNameResolver.java:282)
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.grpclb.GrpclbNameResolver.doResolve(GrpclbNameResolver.java:63)
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:318)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.lang.Thread.run(Thread.java:750)
INFO | jvm 1 | 2022/10/25 12:28:38 | Caused by: java.net.UnknownHostException: pubsub.googleapis.com: Name or service not known
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.InetAddress.getAllByName0(InetAddress.java:1277)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.InetAddress.getAllByName(InetAddress.java:1193)
INFO | jvm 1 | 2022/10/25 12:28:38 | at java.net.InetAddress.getAllByName(InetAddress.java:1127)
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:631)
INFO | jvm 1 | 2022/10/25 12:28:38 | at io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:219)
INFO | jvm 1 | 2022/10/25 12:28:38 | ... 6 more`
This is my code:
public HttpTransportFactory getHttpTranpostFactory(String proxy, String puerto) {
Proxy prox = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxy, Integer.parseInt(puerto)));
HttpTransport httpTransport = new NetHttpTransport.Builder().setProxy(prox).build();
return new HttpTransportFactory() {
#Override
public HttpTransport create() {
return httpTransport;
}
};
}`
In main class:
HttpTransportFactory httpTransport = getHttpTranpostFactory("myvalidproxy.com", "8080");
credentialsProvider = FixedCredentialsProvider.create(
ServiceAccountCredentials.fromStream(new FileInputStream("/path/to/accountservice"), httpTransport));
TopicName topicName = TopicName.of("avalidgcpproject","avalidtopic");
Publisher publisher = Publisher.newBuilder(topicName)
.setEnableCompression(true)
.setCompressionBytesThreshold(100000L)
.setCredentialsProvider(credentialsProvider)
.build();
ByteString data = ByteString.copyFromUtf8("Hello World!");
PubsubMessage pubsubMessage = PubsubMessage.newBuilder()
.setData(data)
.build();
ApiFuture<String> messageIdFuture = publisher.publish(pubsubMessage); //Error is in this line
System.out.println(messageIdFuture.get());`
Maven dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>1.120.16</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.cloud/google-cloud-core -->
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-core</artifactId>
<version>2.8.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20220320</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.3.7</version>
</dependency>
Error is on ApiFuture messageIdFuture = publisher.publish(pubsubMessage); line
When I generate the jar, I have to change the io.grpc.LoadBalancerProvider inside META-INF/services file with content: io.grpc.internal.PickFirstLoadBalancerProvider because if I dont do that, jar thrown another exception.

Cargo logs get stuck after update to Cargo version 1.8.4

after I updated Cargo from version 1.6.2 to the newest version (1.8.4) , Cargo logs seem stuck even if my server works perfectly fine.
===========================================================================================================================================
______ ___ .______ _______ ______ _______ ___ _______ .___ ___. ______ .__ __.
/ | / \ | _ \ / _____| / __ \ | \ / \ | ____|| \/ | / __ \ | \ | |
| ,----' / ^ \ | |_) | | | __ | | | | | .--. | / ^ \ | |__ | \ / | | | | | | \| |
| | / /_\ \ | / | | |_ | | | | | | | | | / /_\ \ | __| | |\/| | | | | | | . ` |
| `----. / _____ \ | |\ \----.| |__| | | `--' | | '--' | / _____ \ | |____ | | | | | `--' | | |\ |
\______|/__/ \__\ | _| `._____| \______| \______/ |_______/ /__/ \__\ |_______||__| |__| \______/ |__| \__|
__ __ ____ ____ _______ __ ______ _______ ____ ____ __ _______ ____ __ ____ _______ .______
| | | | \ \ / / | ____| | | / __ \ / _____|\ \ / / | | | ____|\ \ / \ / / | ____|| _ \
| | | | \ \/ / | |__ | | | | | | | | __ \ \/ / | | | |__ \ \/ \/ / | |__ | |_) |
| | | | \ / | __| | | | | | | | | |_ | \ / | | | __| \ / | __| | /
| `----.| | \ / | |____ | `----.| `--' | | |__| | \ / | | | |____ \ /\ / | |____ | |\ \----.
|_______||__| \__/ |_______| |_______| \______/ \______| \__/ |__| |_______| \__/ \__/ |_______|| _| `._____|
===========================================================================================================================================
DATE Fri Jan 22 12:09:45 CET 2021
[10:35:54.123][info][talledLocalContainer] Tomcat 8.x starting...
[10:35:54.209][warn][stalledLocalDeployer] The WAR contains a context.xml file which sets the path to [webapp], which means path set it the Cargo configuration will be ignored by Tomcat
[10:35:54.209][info][stalledLocalDeployer] Deploying [/home/myapp/.cargo/workspace/myapp/myapp-deployable-2.1.7-SNAPSHOT.war] to [/home/cactus/.cargo/configurations/myapp/webapps]...
[10:36:15.367][info][talledLocalContainer] Tomcat 8.x started on port [8080]
[10:35:44.120][info][talledLocalContainer] Tomcat 8.x is stopping...
[10:35:49.123][info][talledLocalContainer] Tomcat 8.x is stopped
In this example , my application is actually running even if it looks like it has been stopped. And there is a loading icon in the lowest part of the log.
Has anybody had experienced the same problem in the past?

Why spring application is not able to connect to couchbase when running using docker compose

I am trying to run my spring boot application using the docker-compose file but the service running inside the docker container is not able to connect to the database container.
Below is the exception stack trace from docker-compose logs
couchbase-demo | Starting Couchbase Server -- Web UI available at http://<ip>:8091
couchbase-demo | and logs available in /opt/couchbase/var/lib/couchbase/logs
couchbase-demo |
tech-blog | LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy#589446616
tech-blog |
tech-blog | . ____ _ __ _ _
tech-blog | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
tech-blog | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
tech-blog | \\/ ___)| |_)| | | | | || (_| | ) ) ) )
tech-blog | ' |____| .__|_| |_|_| |_\__, | / / / /
tech-blog | =========|_|==============|___/=/_/_/_/
tech-blog | :: Spring Boot :: (v2.2.4.RELEASE)
tech-blog |
tech-blog | 01:33:40.468 [main] INFO com.tech.blog.TechBlogApplication - Starting TechBlogApplication v0.0.2-SNAPSHOT on bf6509f5200d with PID 1 (/opt/tech/techblog.jar started by root in /opt/tech)
tech-blog | 01:33:40.477 [main] DEBUG com.tech.blog.TechBlogApplication - Running with Spring Boot v2.2.4.RELEASE, Spring v5.2.3.RELEASE
tech-blog | 01:33:40.477 [main] INFO com.tech.blog.TechBlogApplication - No active profile set, falling back to default profiles: default
^CGracefully stopping... (press Ctrl+C again to force)
Stopping tech-blog ... done
Stopping couchbase-demo ... done
srinathkavuri#Srinaths-MBP TechBlog % docker logs couchbase-demo
Starting Couchbase Server -- Web UI available at http://<ip>:8091
and logs available in /opt/couchbase/var/lib/couchbase/logs
Waiting for Couchbase Server to start....% srinathkavuri#Srinaths-MBP TechBlog % docker-compose up
Starting couchbase-demo ... done
Starting tech-blog ... done
Attaching to couchbase-demo, tech-blog
couchbase-demo | Starting Couchbase Server -- Web UI available at http://<ip>:8091
couchbase-demo | and logs available in /opt/couchbase/var/lib/couchbase/logs
tech-blog | LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy#1908923184
tech-blog |
tech-blog | . ____ _ __ _ _
tech-blog | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
tech-blog | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
tech-blog | \\/ ___)| |_)| | | | | || (_| | ) ) ) )
tech-blog | ' |____| .__|_| |_|_| |_\__, | / / / /
tech-blog | =========|_|==============|___/=/_/_/_/
tech-blog | :: Spring Boot :: (v2.2.4.RELEASE)
tech-blog |
couchbase-demo |
tech-blog | 02:07:25.243 [main] INFO com.tech.blog.TechBlogApplication - Starting TechBlogApplication v0.0.2-SNAPSHOT on bf6509f5200d with PID 1 (/opt/tech/techblog.jar started by root in /opt/tech)
tech-blog | 02:07:25.250 [main] DEBUG com.tech.blog.TechBlogApplication - Running with Spring Boot v2.2.4.RELEASE, Spring v5.2.3.RELEASE
tech-blog | 02:07:25.251 [main] INFO com.tech.blog.TechBlogApplication - No active profile set, falling back to default profiles: default
tech-blog | 02:07:28.543 [main] INFO o.a.catalina.core.StandardService - Starting service [Tomcat]
tech-blog | 02:07:28.544 [main] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.30]
tech-blog | 02:07:28.683 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
tech-blog | 02:07:29.984 [cb-events] INFO com.couchbase.core - [com.couchbase.core][DnsSrvLookupFailedEvent][30ms] DNS SRV lookup failed (name not found), trying to bootstrap from given hostname directly.
tech-blog | 02:07:30.795 [cb-events] INFO com.couchbase.core - [com.couchbase.core][CoreCreatedEvent] {"clientVersion":"3.0.3","clientGitHash":"e55f7d43","coreVersion":"2.0.4","coreGitHash":"e55f7d43","userAgent":"couchbase-java/3.0.3 (Linux 4.19.76-linuxkit amd64; OpenJDK 64-Bit Server VM 1.8.0_121-b13)","maxNumRequestsInRetry":32768,"ioEnvironment":{"nativeIoEnabled":true,"eventLoopThreadCount":2,"eventLoopGroups":["EpollEventLoopGroup"]},"ioConfig":{"captureTraffic":[],"mutationTokensEnabled":true,"networkResolution":"auto","dnsSrvEnabled":true,"tcpKeepAlivesEnabled":true,"tcpKeepAliveTimeMs":60000,"configPollIntervalMs":2500,"kvCircuitBreakerConfig":"disabled","queryCircuitBreakerConfig":"disabled","viewCircuitBreakerConfig":"disabled","searchCircuitBreakerConfig":"disabled","analyticsCircuitBreakerConfig":"disabled","managerCircuitBreakerConfig":"disabled","numKvConnections":1,"maxHttpConnections":12,"idleHttpConnectionTimeoutMs":30000,"configIdleRedialTimeoutMs":300000},"compressionConfig":{"enabled":true,"minRatio":0.83,"minSize":32},"securityConfig":{"tlsEnabled":false,"nativeTlsEnabled":true,"hasTrustCertificates":false,"trustManagerFactory":null},"timeoutConfig":{"kvMs":10000000,"kvDurableMs":10000,"managementMs":75000,"queryMs":75000,"viewMs":75000,"searchMs":75000,"analyticsMs":75000,"connectMs":10000000,"disconnectMs":10000},"loggerConfig":{"customLogger":null,"fallbackToConsole":false,"disableSlf4j":false,"loggerName":"CouchbaseLogger","diagnosticContextEnabled":false},"orphanReporterConfig":{"emitIntervalMs":10000,"sampleSize":10,"queueLength":1024},"retryStrategy":"BestEffortRetryStrategy","requestTracer":"OwnedSupplier"} {"coreId":"0xce88bae700000001"}
tech-blog | 02:07:30.806 [cb-events] INFO com.couchbase.node - [com.couchbase.node][NodeConnectedEvent] Node connected {"coreId":"0xce88bae700000001","managerPort":"8091","remote":"localhost"}
tech-blog | 02:07:30.829 [cb-events] WARN com.couchbase.endpoint - [com.couchbase.endpoint][EndpointConnectionFailedEvent][271ms] Connect attempt 1 failed because of AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost/127.0.0.1:11210 {"circuitBreaker":"DISABLED","coreId":"0xce88bae700000001","remote":"localhost:11210","type":"KV"}
tech-blog | com.couchbase.client.core.deps.io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost/127.0.0.1:11210
tech-blog | Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
tech-blog | at com.couchbase.client.core.deps.io.netty.channel.unix.Errors.throwConnectException(Errors.java:124)
tech-blog | at com.couchbase.client.core.deps.io.netty.channel.unix.Socket.finishConnect(Socket.java:243)
tech-blog | at com.couchbase.client.core.deps.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:672)
tech-blog | at com.couchbase.client.core.deps.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:649)
tech-blog | at com.couchbase.client.core.deps.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:529)
tech-blog | at com.couchbase.client.core.deps.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:465)
tech-blog | at com.couchbase.client.core.deps.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
tech-blog | at com.couchbase.client.core.deps.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
tech-blog | at com.couchbase.client.core.deps.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
tech-blog | at com.couchbase.client.core.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
tech-blog | at java.lang.Thread.run(Thread.java:745)
Below is my docker-compose file.
services:
couchbase.lcl:
image: bentonam/couchbase-docker:latest
container_name: couchbase-demo
ports:
- "8091-8094:8091-8094"
- "11210:11210"
environment:
CLUSTER_USERNAME: Administrator
CLUSTER_PASSWORD: pass
CLUSTER_NAME: TECH_BLOG_CLUSTER
SERVICES: data,index,query,fts
CLUSTER_RAMSIZE: 500
BUCKET: user-profile
BUCKET_RAMSIZE: 300
NODE_INIT_INDEX_PATH: /opt/couchbase/var/lib/couchbase/indexes
networks:
- tech-blog-network
techblog.lcl:
image: docker-tech-blog:latest
restart: always
container_name: tech-blog
links:
- couchbase.lcl
environment:
COUCHBASE_HOST: couchbase.lcl
depends_on:
- couchbase.lcl
ports:
- "8123:8123"
networks:
- tech-blog-network
networks:
tech-blog-network:
driver: bridge
Can anyone please let me know is there any issue with my docker-compose file?
Below is my spring configuration file
server:
port: 8123
logging:
level:
org.springframework: ERROR
com.tech.blog: DEBUG
pattern:
console: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
file: "%d %p %c{1.} [%t] %m%n"
file: /var/log/techblog.log
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: "*"
health:
defaults:
enabled: false
cb:
connectionTimeOut: 10000
kvTimeOut: 10000
hosts: localhost
cluster:
username: Administrator
password: pass
bucketname: user-profile
its not localhost when you are using docker container for each service.
change: hosts: localhost
to: hosts: couchbase.lcl

Creating SparkSession using Java 1.8 and Spark2.2

I am very new to distributed computing . I an able to run similar code in Spark 2.2 on my local machine without any issue. Now I am trying to do the same in Java and I keep on getting this error. I can create JavaSparkContext and use this object in my code .Issue is when I create SparkSession using builder.
My Local environment is : Window 7 , Spark 2.2 , Java 1.8
My Code looks like
public static void main(String[] args) {
SparkConf sparkConf = new SparkConf();
sparkConf.setAppName("Java-Spark");
sparkConf.setMaster("local");
SparkSession sc= SparkSession.builder().appName("test").master("local[*]").config("spark.driver.cores", 1).getOrCreate();
/* this commented code works fine.
JavaSparkContext context = new JavaSparkContext(sparkConf);
JavaRDD<Integer> numbersRDD = context.parallelize(Arrays.asList(1,2,3));
JavaRDD<Integer> squaresRDD = numbersRDD.map( n -> n*n );
System.out.println("1 :");
System.out.println(squaresRDD.collect().toString());
JavaRDD<Integer> evenRDD = squaresRDD.filter( n -> n%2==0 );
System.out.println("2 :");
System.out.println(evenRDD.collect().toString());
JavaRDD<Integer> multipliedRDD = numbersRDD.flatMap( n->Arrays.asList(n,n*2,n*3).iterator());
System.out.println("3 :");
System.out.println(multipliedRDD.collect().toString());
context.close();
*/
sc.close();
}
I am using Maven to manage dependencies. pom.xml looks like
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ICC_POC</groupId>
<artifactId>spark</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spark</name>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.bazaarvoice.jolt</groupId>
<artifactId>jolt-complete</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>com.bazaarvoice.jolt</groupId>
<artifactId>jolt-core</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-launcher_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-network-common_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-network-shuffle_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-unsafe_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-tags_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-catalyst_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sketch_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-asm5-shaded</artifactId>
<version>4.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
</plugin>
</plugins>
</build>
</project>
I am struggling with this error from last 2 days and cannot figure out what I am missing here. Need another pair of eyes to find the issue . Thanks
EDIT: Adding output for mvn dependency:tree
ICC_POC:spark:jar:0.0.1-SNAPSHOT
+- org.apache.spark:spark-core_2.11:jar:2.2.0:compile
| +- org.apache.avro:avro:jar:1.7.7:compile
| | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
| | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
| | +- com.thoughtworks.paranamer:paranamer:jar:2.3:compile
| | \- org.apache.commons:commons-compress:jar:1.4.1:compile
| | \- org.tukaani:xz:jar:1.0:compile
| +- org.apache.avro:avro-mapred:jar:hadoop2:1.7.7:compile
| | +- org.apache.avro:avro-ipc:jar:1.7.7:compile
| | \- org.apache.avro:avro-ipc:jar:tests:1.7.7:compile
| +- com.twitter:chill_2.11:jar:0.8.0:compile
| | \- com.esotericsoftware:kryo-shaded:jar:3.0.3:compile
| | +- com.esotericsoftware:minlog:jar:1.3.0:compile
| | \- org.objenesis:objenesis:jar:2.1:compile
| +- com.twitter:chill-java:jar:0.8.0:compile
| +- org.apache.hadoop:hadoop-client:jar:2.6.5:compile
| | +- org.apache.hadoop:hadoop-common:jar:2.6.5:compile
| | | +- commons-cli:commons-cli:jar:1.2:compile
| | | +- xmlenc:xmlenc:jar:0.52:compile
| | | +- commons-httpclient:commons-httpclient:jar:3.1:compile
| | | +- commons-io:commons-io:jar:2.4:compile
| | | +- commons-collections:commons-collections:jar:3.2.2:compile
| | | +- commons-lang:commons-lang:jar:2.6:compile
| | | +- commons-configuration:commons-configuration:jar:1.6:compile
| | | | +- commons-digester:commons-digester:jar:1.8:compile
| | | | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
| | | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
| | | +- com.google.protobuf:protobuf-java:jar:2.5.0:compile
| | | +- com.google.code.gson:gson:jar:2.2.4:compile
| | | +- org.apache.hadoop:hadoop-auth:jar:2.6.5:compile
| | | | \- org.apache.directory.server:apacheds-kerberos-codec:jar:2.0.0-M15:compile
| | | | +- org.apache.directory.server:apacheds-i18n:jar:2.0.0-M15:compile
| | | | +- org.apache.directory.api:api-asn1-api:jar:1.0.0-M20:compile
| | | | \- org.apache.directory.api:api-util:jar:1.0.0-M20:compile
| | | +- org.apache.curator:curator-client:jar:2.6.0:compile
| | | \- org.htrace:htrace-core:jar:3.0.4:compile
| | +- org.apache.hadoop:hadoop-hdfs:jar:2.6.5:compile
| | | +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
| | | \- xerces:xercesImpl:jar:2.9.1:compile
| | | \- xml-apis:xml-apis:jar:1.3.04:compile
| | +- org.apache.hadoop:hadoop-mapreduce-client-app:jar:2.6.5:compile
| | | +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.6.5:compile
| | | | +- org.apache.hadoop:hadoop-yarn-client:jar:2.6.5:compile
| | | | \- org.apache.hadoop:hadoop-yarn-server-common:jar:2.6.5:compile
| | | \- org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.6.5:compile
| | +- org.apache.hadoop:hadoop-yarn-api:jar:2.6.5:compile
| | +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.6.5:compile
| | | \- org.apache.hadoop:hadoop-yarn-common:jar:2.6.5:compile
| | | +- javax.xml.bind:jaxb-api:jar:2.2.2:compile
| | | | \- javax.xml.stream:stax-api:jar:1.0-2:compile
| | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.13:compile
| | | \- org.codehaus.jackson:jackson-xc:jar:1.9.13:compile
| | +- org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.6.5:compile
| | \- org.apache.hadoop:hadoop-annotations:jar:2.6.5:compile
| +- net.java.dev.jets3t:jets3t:jar:0.9.3:compile
| | +- org.apache.httpcomponents:httpcore:jar:4.3.3:compile
| | +- org.apache.httpcomponents:httpclient:jar:4.3.6:compile
| | +- commons-codec:commons-codec:jar:1.8:compile
| | +- javax.activation:activation:jar:1.1.1:compile
| | +- mx4j:mx4j:jar:3.0.2:compile
| | +- javax.mail:mail:jar:1.4.7:compile
| | +- org.bouncycastle:bcprov-jdk15on:jar:1.51:compile
| | \- com.jamesmurty.utils:java-xmlbuilder:jar:1.0:compile
| | \- net.iharder:base64:jar:2.3.8:compile
| +- org.apache.curator:curator-recipes:jar:2.6.0:compile
| | +- org.apache.curator:curator-framework:jar:2.6.0:compile
| | +- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
| | \- com.google.guava:guava:jar:16.0.1:compile
| +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
| +- org.apache.commons:commons-lang3:jar:3.5:compile
| +- org.apache.commons:commons-math3:jar:3.4.1:compile
| +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
| +- org.slf4j:slf4j-api:jar:1.7.16:compile
| +- org.slf4j:jul-to-slf4j:jar:1.7.16:compile
| +- org.slf4j:jcl-over-slf4j:jar:1.7.16:compile
| +- log4j:log4j:jar:1.2.17:compile
| +- org.slf4j:slf4j-log4j12:jar:1.7.16:compile
| +- com.ning:compress-lzf:jar:1.0.3:compile
| +- org.xerial.snappy:snappy-java:jar:1.1.2.6:compile
| +- net.jpountz.lz4:lz4:jar:1.3.0:compile
| +- org.roaringbitmap:RoaringBitmap:jar:0.5.11:compile
| +- commons-net:commons-net:jar:2.2:compile
| +- org.scala-lang:scala-library:jar:2.11.8:compile
| +- org.json4s:json4s-jackson_2.11:jar:3.2.11:compile
| | \- org.json4s:json4s-core_2.11:jar:3.2.11:compile
| | +- org.json4s:json4s-ast_2.11:jar:3.2.11:compile
| | \- org.scala-lang:scalap:jar:2.11.0:compile
| | \- org.scala-lang:scala-compiler:jar:2.11.0:compile
| | +- org.scala-lang.modules:scala-xml_2.11:jar:1.0.1:compile
| | \- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.1:compile
| +- org.glassfish.jersey.core:jersey-client:jar:2.22.2:compile
| | +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
| | +- org.glassfish.hk2:hk2-api:jar:2.4.0-b34:compile
| | | +- org.glassfish.hk2:hk2-utils:jar:2.4.0-b34:compile
| | | \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b34:compile
| | +- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b34:compile
| | \- org.glassfish.hk2:hk2-locator:jar:2.4.0-b34:compile
| | \- org.javassist:javassist:jar:3.18.1-GA:compile
| +- org.glassfish.jersey.core:jersey-common:jar:2.22.2:compile
| | +- javax.annotation:javax.annotation-api:jar:1.2:compile
| | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.22.2:compile
| | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
| +- org.glassfish.jersey.core:jersey-server:jar:2.22.2:compile
| | +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.22.2:compile
| | \- javax.validation:validation-api:jar:1.1.0.Final:compile
| +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.22.2:compile
| +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.22.2:compile
| +- io.netty:netty-all:jar:4.0.43.Final:compile
| +- io.netty:netty:jar:3.9.9.Final:compile
| +- com.clearspring.analytics:stream:jar:2.7.0:compile
| +- io.dropwizard.metrics:metrics-core:jar:3.1.2:compile
| +- io.dropwizard.metrics:metrics-jvm:jar:3.1.2:compile
| +- io.dropwizard.metrics:metrics-json:jar:3.1.2:compile
| +- io.dropwizard.metrics:metrics-graphite:jar:3.1.2:compile
| +- com.fasterxml.jackson.core:jackson-databind:jar:2.6.5:compile
| | \- com.fasterxml.jackson.core:jackson-core:jar:2.6.5:compile
| +- com.fasterxml.jackson.module:jackson-module-scala_2.11:jar:2.6.5:compile
| | +- org.scala-lang:scala-reflect:jar:2.11.7:compile
| | \- com.fasterxml.jackson.module:jackson-module-paranamer:jar:2.6.5:compile
| +- org.apache.ivy:ivy:jar:2.4.0:compile
| +- oro:oro:jar:2.0.8:compile
| +- net.razorvine:pyrolite:jar:4.13:compile
| +- net.sf.py4j:py4j:jar:0.10.4:compile
| +- org.apache.commons:commons-crypto:jar:1.0.0:compile
| \- org.spark-project.spark:unused:jar:1.0.0:compile
+- com.bazaarvoice.jolt:jolt-complete:jar:0.1.0:compile
| \- com.bazaarvoice.jolt:json-utils:jar:0.1.0:compile
+- com.bazaarvoice.jolt:jolt-core:jar:0.1.0:compile
| \- javax.inject:javax.inject:jar:1:compile
+- org.apache.spark:spark-launcher_2.11:jar:2.2.0:compile
+- org.apache.spark:spark-network-common_2.11:jar:2.2.0:compile
| +- org.fusesource.leveldbjni:leveldbjni-all:jar:1.8:compile
| \- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.5:compile
+- org.apache.spark:spark-network-shuffle_2.11:jar:2.2.0:compile
+- org.apache.spark:spark-unsafe_2.11:jar:2.2.0:compile
+- org.apache.spark:spark-tags_2.11:jar:2.2.0:compile
+- org.apache.spark:spark-sql_2.11:jar:2.2.0:compile
| +- com.univocity:univocity-parsers:jar:2.2.1:compile
| +- org.apache.parquet:parquet-column:jar:1.8.2:compile
| | +- org.apache.parquet:parquet-common:jar:1.8.2:compile
| | \- org.apache.parquet:parquet-encoding:jar:1.8.2:compile
| \- org.apache.parquet:parquet-hadoop:jar:1.8.2:compile
| +- org.apache.parquet:parquet-format:jar:2.3.1:compile
| \- org.apache.parquet:parquet-jackson:jar:1.8.2:compile
+- org.apache.spark:spark-catalyst_2.11:jar:2.2.0:compile
+- org.apache.spark:spark-sketch_2.11:jar:2.2.0:compile
\- org.apache.xbean:xbean-asm5-shaded:jar:4.5:compile
I am able to resolve this issue. I looked into project dependency generated by mvn and found ANTLR ref was missing. Added it into mvn dependncy list and code started working. Thanks Alexandre Dupriez for pointing it. I had never guess it by myself.

Why does my Spring Boot boot 5 times?

I am using Spring boot for my tomcat deploy of my webapp. On my mac, and on a fellow developers linux install (not sure of his distro), the catalina.out file has just one instance of the spring ascii art indicating that it booted up just once as expected.
On our development and production servers, both centOS and mirrors of one another, the catalina.out file has five instances of the Spring ascii art indicating that it is "booting" 5 times! I have code that runs in the onStartup method of my RestApplication that extends SpringBootServletInitializer and that code runs 5 times verifying that spring is booting up 5 times. Why is this happening on our production machines but not on our development machines? War files are deployed to tomcat 8 in all instances.
It takes many minutes before the webapp is ready as a result.
At first I thought maybe it was linked the number of clases tagged #RestController since that seemed about 5, but it turns out we have 7 classes with this tag. So, I can't find anything that would match up with this number of 5 boots.
Any thoughts? Cheers.
UPDATE
Here is my log file with an exception stack trace in the onStartup method. It is looking for a file of the name servletContext.getContextPath() + "_init.properties". As you can see we are alternating between a DeployWar with the name of "wildbook" (correct name of my war file) and a StartChild with the name of "". Except the last DeployWar does not seem to trigger a StartChild.
INFO | jvm 1 | 2015/09/30 19:40:53 |
INFO | jvm 1 | 2015/09/30 19:40:53 | . ____ _ __ _ _
INFO | jvm 1 | 2015/09/30 19:40:53 | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
INFO | jvm 1 | 2015/09/30 19:40:53 | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
INFO | jvm 1 | 2015/09/30 19:40:53 | \\/ ___)| |_)| | | | | || (_| | ) ) ) )
INFO | jvm 1 | 2015/09/30 19:40:53 | ' |____| .__|_| |_|_| |_\__, | / / / /
INFO | jvm 1 | 2015/09/30 19:40:53 | =========|_|==============|___/=/_/_/_/
INFO | jvm 1 | 2015/09/30 19:40:53 | :: Spring Boot :: (v1.2.1.RELEASE)
INFO | jvm 1 | 2015/09/30 19:40:53 |
INFO | jvm 1 | 2015/09/30 19:41:02 | [WARN] org.ecocean.rest.RestApplication - Can't read init property file, building simple props from init params.
INFO | jvm 1 | 2015/09/30 19:41:02 | java.io.FileNotFoundException: /opt/tomcat8/conf/wildbook_init.properties (No such file or directory)
INFO | jvm 1 | 2015/09/30 19:41:02 | at java.io.FileInputStream.open(Native Method) ~[na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:02 | at java.io.FileInputStream.<init>(FileInputStream.java:131) ~[na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:02 | at com.samsix.util.io.ResourceReaderImpl.addSource(ResourceReaderImpl.java:1182) ~[s6-util-1.0.6.jar:na]
INFO | jvm 1 | 2015/09/30 19:41:02 | at org.ecocean.rest.RestApplication.onStartup(RestApplication.java:98) ~[RestApplication.class:na]
INFO | jvm 1 | 2015/09/30 19:41:02 | at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.1.4.RELEASE.jar:4.1.4.RELEASE]
INFO | jvm 1 | 2015/09/30 19:41:02 | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:02 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:02 | at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:02 | at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:02 | at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:02 | at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:02 | at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:02 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:02 | at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:02 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:02 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:02 | at java.lang.Thread.run(Thread.java:745) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:03 | [WARN] o.f.core.internal.command.DbMigrate - outOfOrder mode is active. Migration of schema "public" may not be reproducible.
INFO | jvm 1 | 2015/09/30 19:41:17 |
INFO | jvm 1 | 2015/09/30 19:41:17 | . ____ _ __ _ _
INFO | jvm 1 | 2015/09/30 19:41:17 | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
INFO | jvm 1 | 2015/09/30 19:41:17 | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
INFO | jvm 1 | 2015/09/30 19:41:17 | \\/ ___)| |_)| | | | | || (_| | ) ) ) )
INFO | jvm 1 | 2015/09/30 19:41:17 | ' |____| .__|_| |_|_| |_\__, | / / / /
INFO | jvm 1 | 2015/09/30 19:41:17 | =========|_|==============|___/=/_/_/_/
INFO | jvm 1 | 2015/09/30 19:41:17 | :: Spring Boot :: (v1.2.1.RELEASE)
INFO | jvm 1 | 2015/09/30 19:41:17 |
INFO | jvm 1 | 2015/09/30 19:41:24 | [WARN] org.ecocean.rest.RestApplication - Can't read init property file, building simple props from init params.
INFO | jvm 1 | 2015/09/30 19:41:24 | java.io.FileNotFoundException: /opt/tomcat8/conf/_init.properties (No such file or directory)
INFO | jvm 1 | 2015/09/30 19:41:24 | at java.io.FileInputStream.open(Native Method) ~[na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:24 | at java.io.FileInputStream.<init>(FileInputStream.java:131) ~[na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:24 | at com.samsix.util.io.ResourceReaderImpl.addSource(ResourceReaderImpl.java:1182) ~[s6-util-1.0.6.jar:na]
INFO | jvm 1 | 2015/09/30 19:41:24 | at org.ecocean.rest.RestApplication.onStartup(RestApplication.java:98) ~[RestApplication.class:na]
INFO | jvm 1 | 2015/09/30 19:41:24 | at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.1.4.RELEASE.jar:4.1.4.RELEASE]
INFO | jvm 1 | 2015/09/30 19:41:24 | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:24 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:24 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:24 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:24 | at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:24 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:24 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:24 | at java.lang.Thread.run(Thread.java:745) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:25 | [WARN] o.f.core.internal.command.DbMigrate - outOfOrder mode is active. Migration of schema "public" may not be reproducible.
INFO | jvm 1 | 2015/09/30 19:41:34 |
INFO | jvm 1 | 2015/09/30 19:41:34 | . ____ _ __ _ _
INFO | jvm 1 | 2015/09/30 19:41:34 | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
INFO | jvm 1 | 2015/09/30 19:41:34 | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
INFO | jvm 1 | 2015/09/30 19:41:34 | \\/ ___)| |_)| | | | | || (_| | ) ) ) )
INFO | jvm 1 | 2015/09/30 19:41:34 | ' |____| .__|_| |_|_| |_\__, | / / / /
INFO | jvm 1 | 2015/09/30 19:41:34 | =========|_|==============|___/=/_/_/_/
INFO | jvm 1 | 2015/09/30 19:41:34 | :: Spring Boot :: (v1.2.1.RELEASE)
INFO | jvm 1 | 2015/09/30 19:41:34 |
INFO | jvm 1 | 2015/09/30 19:41:40 | [WARN] org.ecocean.rest.RestApplication - Can't read init property file, building simple props from init params.
INFO | jvm 1 | 2015/09/30 19:41:40 | java.io.FileNotFoundException: /opt/tomcat8/conf/wildbook_init.properties (No such file or directory)
INFO | jvm 1 | 2015/09/30 19:41:40 | at java.io.FileInputStream.open(Native Method) ~[na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:40 | at java.io.FileInputStream.<init>(FileInputStream.java:131) ~[na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:40 | at com.samsix.util.io.ResourceReaderImpl.addSource(ResourceReaderImpl.java:1182) ~[s6-util-1.0.6.jar:na]
INFO | jvm 1 | 2015/09/30 19:41:40 | at org.ecocean.rest.RestApplication.onStartup(RestApplication.java:98) ~[RestApplication.class:na]
INFO | jvm 1 | 2015/09/30 19:41:40 | at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.1.4.RELEASE.jar:4.1.4.RELEASE]
INFO | jvm 1 | 2015/09/30 19:41:40 | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:40 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:40 | at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:40 | at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:40 | at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:40 | at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:40 | at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:40 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:40 | at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:40 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:40 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:40 | at java.lang.Thread.run(Thread.java:745) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:41 | [WARN] o.f.core.internal.command.DbMigrate - outOfOrder mode is active. Migration of schema "public" may not be reproducible.
INFO | jvm 1 | 2015/09/30 19:41:50 |
INFO | jvm 1 | 2015/09/30 19:41:50 | . ____ _ __ _ _
INFO | jvm 1 | 2015/09/30 19:41:50 | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
INFO | jvm 1 | 2015/09/30 19:41:50 | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
INFO | jvm 1 | 2015/09/30 19:41:50 | \\/ ___)| |_)| | | | | || (_| | ) ) ) )
INFO | jvm 1 | 2015/09/30 19:41:50 | ' |____| .__|_| |_|_| |_\__, | / / / /
INFO | jvm 1 | 2015/09/30 19:41:50 | =========|_|==============|___/=/_/_/_/
INFO | jvm 1 | 2015/09/30 19:41:50 | :: Spring Boot :: (v1.2.1.RELEASE)
INFO | jvm 1 | 2015/09/30 19:41:50 |
INFO | jvm 1 | 2015/09/30 19:41:55 | [WARN] org.ecocean.rest.RestApplication - Can't read init property file, building simple props from init params.
INFO | jvm 1 | 2015/09/30 19:41:55 | java.io.FileNotFoundException: /opt/tomcat8/conf/_init.properties (No such file or directory)
INFO | jvm 1 | 2015/09/30 19:41:55 | at java.io.FileInputStream.open(Native Method) ~[na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:55 | at java.io.FileInputStream.<init>(FileInputStream.java:131) ~[na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:55 | at com.samsix.util.io.ResourceReaderImpl.addSource(ResourceReaderImpl.java:1182) ~[s6-util-1.0.6.jar:na]
INFO | jvm 1 | 2015/09/30 19:41:55 | at org.ecocean.rest.RestApplication.onStartup(RestApplication.java:98) ~[RestApplication.class:na]
INFO | jvm 1 | 2015/09/30 19:41:55 | at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.1.4.RELEASE.jar:4.1.4.RELEASE]
INFO | jvm 1 | 2015/09/30 19:41:55 | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:55 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:55 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:55 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:41:55 | at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:55 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:55 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:55 | at java.lang.Thread.run(Thread.java:745) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:41:56 | [WARN] o.f.core.internal.command.DbMigrate - outOfOrder mode is active. Migration of schema "public" may not be reproducible.
INFO | jvm 1 | 2015/09/30 19:42:05 |
INFO | jvm 1 | 2015/09/30 19:42:05 | . ____ _ __ _ _
INFO | jvm 1 | 2015/09/30 19:42:05 | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
INFO | jvm 1 | 2015/09/30 19:42:05 | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
INFO | jvm 1 | 2015/09/30 19:42:05 | \\/ ___)| |_)| | | | | || (_| | ) ) ) )
INFO | jvm 1 | 2015/09/30 19:42:05 | ' |____| .__|_| |_|_| |_\__, | / / / /
INFO | jvm 1 | 2015/09/30 19:42:05 | =========|_|==============|___/=/_/_/_/
INFO | jvm 1 | 2015/09/30 19:42:05 | :: Spring Boot :: (v1.2.1.RELEASE)
INFO | jvm 1 | 2015/09/30 19:42:05 |
INFO | jvm 1 | 2015/09/30 19:42:13 | [WARN] org.ecocean.rest.RestApplication - Can't read init property file, building simple props from init params.
INFO | jvm 1 | 2015/09/30 19:42:13 | java.io.FileNotFoundException: /opt/tomcat8/conf/wildbook_init.properties (No such file or directory)
INFO | jvm 1 | 2015/09/30 19:42:13 | at java.io.FileInputStream.open(Native Method) ~[na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:42:13 | at java.io.FileInputStream.<init>(FileInputStream.java:131) ~[na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:42:13 | at com.samsix.util.io.ResourceReaderImpl.addSource(ResourceReaderImpl.java:1182) ~[s6-util-1.0.6.jar:na]
INFO | jvm 1 | 2015/09/30 19:42:13 | at org.ecocean.rest.RestApplication.onStartup(RestApplication.java:98) ~[RestApplication.class:na]
INFO | jvm 1 | 2015/09/30 19:42:13 | at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.1.4.RELEASE.jar:4.1.4.RELEASE]
INFO | jvm 1 | 2015/09/30 19:42:13 | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:42:13 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:42:13 | at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:42:13 | at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:42:13 | at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:42:13 | at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:42:13 | at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701) [catalina.jar:8.0.18]
INFO | jvm 1 | 2015/09/30 19:42:13 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:42:13 | at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:42:13 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:42:13 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:42:13 | at java.lang.Thread.run(Thread.java:745) [na:1.8.0_11]
INFO | jvm 1 | 2015/09/30 19:42:13 | [WARN] o.f.core.internal.command.DbMigrate - outOfOrder mode is active. Migration of schema "public" may not be reproducible.
Second Update
Here is my SpringBootServletInitializer in it's entirety as requested.
package org.ecocean.rest;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import org.ecocean.ShepherdPMF;
import org.flywaydb.core.Flyway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import com.samsix.database.ConnectionInfo;
#Configuration
#EnableAutoConfiguration
#ComponentScan
public class RestApplication extends SpringBootServletInitializer {
/**
* This method should allow you to start up the rest service from a compiled jar rather
* than having to make a war and stick it in tomcat.
*/
public static void main(final String[] args) {
SpringApplication.run(RestApplication.class, args);
}
#Override
protected final SpringApplicationBuilder configure(final SpringApplicationBuilder application) {
// ObjectMapper mapper = new ObjectMapper();
// mapper.registerModule(new JodaModule());
return application.sources(RestApplication.class);
}
#Override
public void onStartup(final ServletContext servletContext) throws ServletException
{
super.onStartup(servletContext);
//
// Uses default location of db/migration on classpath. You will find it in the src/main/resources folder.
// OutOfOrder = true makes it so that if two developers create SQL in a different order and one somehow
// gets applied to the database, the other's should too. This should only be an issue on development
// databases and allows me to get other developers sql patches even if I've applied a newer one myself
// locally. In production, everything should be fine.
//
ConnectionInfo connectionInfo = ShepherdPMF.getConnectionInfo();
Flyway flyway = new Flyway();
flyway.setOutOfOrder(true);
flyway.setSqlMigrationPrefix("");
flyway.setDataSource(connectionInfo.getUrl(), connectionInfo.getUserName(), connectionInfo.getPassword());
flyway.migrate();
}
#Bean
public ServletRegistrationBean servletRegistrationBean(){
return new ServletRegistrationBean(new MediaUploadServlet(),"/mediaupload");
}
}

Categories