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");
}
}
Related
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
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?
I'm really stuck with a problem
I have built an Axis 2 client running against an API using a .WSDL file. I have used a local jetty server when I have developed, but I need to move it over to a local tomcat server. When I moved my .war file to the local Tomcat, I get the following error. Can someone please give me some advice so I'm going in the right direction
SLL debug in tomcat:
http-nio-8080-exec-1, WRITE: TLSv1.2 Handshake, length = 189
http-nio-8080-exec-1, handling exception: java.net.SocketException: Connection reset
http-nio-8080-exec-1, SEND TLSv1.2 ALERT: fatal, description = unexpected_message
http-nio-8080-exec-1, WRITE: TLSv1.2 Alert, length = 2
http-nio-8080-exec-1, Exception sending alert: java.net.SocketException: Connection reset by peer: socket write error
http-nio-8080-exec-1, called closeSocket()
http-nio-8080-exec-1, called close()
http-nio-8080-exec-1, called closeInternal(true)
A
INFO | jvm 1 | 2016/12/21 13:28:59.193 | Unable to sendViaPost to url[https://someurl.com/Service.svc]
INFO | jvm 1 | 2016/12/21 13:28:59.194 | org.apache.axis2.AxisFault: Connection reset
INFO | jvm 1 | 2016/12/21 13:28:59.196 | at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
INFO | jvm 1 | 2016/12/21 13:28:59.197 | at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:99)
INFO | jvm 1 | 2016/12/21 13:28:59.198 | at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
INFO | jvm 1 | 2016/12/21 13:28:59.199 | at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
INFO | jvm 1 | 2016/12/21 13:28:59.201 | at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
INFO | jvm 1 | 2016/12/21 13:28:59.204 | at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
INFO | jvm 1 | 2016/12/21 13:28:59.205 | at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
INFO | jvm 1 | 2016/12/21 13:28:59.206 | at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
INFO | jvm 1 | 2016/12/21 13:28:59.207 | at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.executeMethod(HTTPSenderImpl.java:900)
INFO | jvm 1 | 2016/12/21 13:28:59.209 | at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:212)
INFO | jvm 1 | 2016/12/21 13:28:59.213 | at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121)
INFO | jvm 1 | 2016/12/21 13:28:59.215 | at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403)
INFO | jvm 1 | 2016/12/21 13:28:59.218 | at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234)
INFO | jvm 1 | 2016/12/21 13:28:59.220 | at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
INFO | jvm 1 | 2016/12/21 13:28:59.222 | at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:399)
INFO | jvm 1 | 2016/12/21 13:28:59.224 | at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
INFO | jvm 1 | 2016/12/21 13:28:59.227 | at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
INFO | jvm 1 | 2016/12/21 13:28:59.229 | at se.docpub.documentfolderservice.DocumentFolderServiceStub.loadFolder(DocumentFolderServiceStub.java:769)
INFO | jvm 1 | 2016/12/21 13:28:59.231 | at se.soleilit.document_api.resources.DocumentResource.getPublishedFolder(DocumentResource.java:96)
INFO | jvm 1 | 2016/12/21 13:28:59.233 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2016/12/21 13:28:59.235 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:28:59.236 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:28:59.237 | at java.lang.reflect.Method.invoke(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:28:59.239 | at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
INFO | jvm 1 | 2016/12/21 13:28:59.246 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
INFO | jvm 1 | 2016/12/21 13:28:59.250 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
INFO | jvm 1 | 2016/12/21 13:28:59.255 | at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
INFO | jvm 1 | 2016/12/21 13:28:59.265 | at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
INFO | jvm 1 | 2016/12/21 13:28:59.270 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
INFO | jvm 1 | 2016/12/21 13:28:59.279 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
INFO | jvm 1 | 2016/12/21 13:28:59.283 | at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
INFO | jvm 1 | 2016/12/21 13:28:59.290 | at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
INFO | jvm 1 | 2016/12/21 13:28:59.298 | at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
INFO | jvm 1 | 2016/12/21 13:28:59.302 | at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
INFO | jvm 1 | 2016/12/21 13:28:59.304 | at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
INFO | jvm 1 | 2016/12/21 13:28:59.306 | at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
INFO | jvm 1 | 2016/12/21 13:28:59.308 | at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
INFO | jvm 1 | 2016/12/21 13:28:59.314 | at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
INFO | jvm 1 | 2016/12/21 13:28:59.316 | at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
INFO | jvm 1 | 2016/12/21 13:28:59.324 | at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
INFO | jvm 1 | 2016/12/21 13:28:59.330 | at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
INFO | jvm 1 | 2016/12/21 13:28:59.333 | at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
INFO | jvm 1 | 2016/12/21 13:28:59.336 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
INFO | jvm 1 | 2016/12/21 13:28:59.339 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
INFO | jvm 1 | 2016/12/21 13:28:59.345 | at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
INFO | jvm 1 | 2016/12/21 13:28:59.348 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
INFO | jvm 1 | 2016/12/21 13:28:59.352 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
INFO | jvm 1 | 2016/12/21 13:28:59.354 | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
INFO | jvm 1 | 2016/12/21 13:28:59.356 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
INFO | jvm 1 | 2016/12/21 13:28:59.357 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
INFO | jvm 1 | 2016/12/21 13:28:59.363 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
INFO | jvm 1 | 2016/12/21 13:28:59.365 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
INFO | jvm 1 | 2016/12/21 13:28:59.367 | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
INFO | jvm 1 | 2016/12/21 13:28:59.369 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
INFO | jvm 1 | 2016/12/21 13:28:59.371 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
INFO | jvm 1 | 2016/12/21 13:28:59.373 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
INFO | jvm 1 | 2016/12/21 13:28:59.375 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
INFO | jvm 1 | 2016/12/21 13:28:59.376 | at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
INFO | jvm 1 | 2016/12/21 13:29:00.224 | at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
INFO | jvm 1 | 2016/12/21 13:29:00.532 | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
INFO | jvm 1 | 2016/12/21 13:29:00.534 | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
INFO | jvm 1 | 2016/12/21 13:29:00.535 | at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.537 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.539 | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
INFO | jvm 1 | 2016/12/21 13:29:00.541 | at java.lang.Thread.run(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.542 | Caused by: java.net.SocketException: Connection reset
INFO | jvm 1 | 2016/12/21 13:29:00.543 | at java.net.SocketInputStream.read(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.555 | at java.net.SocketInputStream.read(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.558 | at sun.security.ssl.InputRecord.readFully(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.560 | at sun.security.ssl.InputRecord.readV3Record(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.573 | at sun.security.ssl.InputRecord.read(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.590 | at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.593 | at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.618 | at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.621 | at sun.security.ssl.AppOutputStream.write(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.656 | at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.659 | at java.io.BufferedOutputStream.flush(Unknown Source)
INFO | jvm 1 | 2016/12/21 13:29:00.726 | at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:95)
INFO | jvm 1 | 2016/12/21 13:29:00.738 | ... 63 more
I am using Spring-security-web-3.2.5 jar and Java 8 and Spring-web-mvc 4.1.7 in hybris 6 Platform.
I am getting Nullpointer Exception in ApplicationFilterProxy and in class
AbstractRememberMeServices.
When I debug this class I observed that the logger object is null and when code is trying to perform the following operation , throws NullPointer Exception
this.logger.debug("Interactive login attempt was unsuccessful.");
Exception StackTrace :
SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [] threw exception [Error while processing internal filterchain. Exception occurred at chain position: 9 of 16. Current filter: 'FilterChainProxy[Filter Chains: [[ Ant [pattern='/_ui/**'], []], [ Ant [pattern='/checkout/**'], [org.springframework.security.web.access.channel.ChannelProcessingFilter#f6a714c, org.springframework.security.web.context.SecurityContextPersistenceFilter#3aa9c43e, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#148b51b7, org.springframework.security.web.authentication.logout.LogoutFilter#7dc977d4, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#21759930, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#55893114, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#1bc1c4fb, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#2d007780, org.springframework.security.web.access.ExceptionTranslationFilter#20b1d709, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#3c2c439a]], [ com.example.storefront.security.ExcludeUrlRequestMatcher#3a6c99ce, [org.springframework.security.web.access.channel.ChannelProcessingFilter#31cb980a, org.springframework.security.web.context.SecurityContextPersistenceFilter#3ef9fc3c, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#28aef10c, org.springframework.security.web.authentication.logout.LogoutFilter#7652af3e, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#1bb47236, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#6add7560, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#3524cfa6, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter#566cad63, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#6ef1505a, org.springframework.security.web.access.ExceptionTranslationFilter#6f065e91, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#7ccce528]]]]'!; nested exception is java.lang.NullPointerException] with root cause
INFO | jvm 1 | main | 2016/09/22 15:23:01.365 | java.lang.NullPointerException
INFO | jvm 1 | main | 2016/09/22 15:23:01.366 | at org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices.loginFail(AbstractRememberMeServices.java:239)
INFO | jvm 1 | main | 2016/09/22 15:23:01.369 | at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.unsuccessfulAuthentication(AbstractAuthenticationProcessingFilter.java:353)
INFO | jvm 1 | main | 2016/09/22 15:23:01.369 | at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:225)
INFO | jvm 1 | main | 2016/09/22 15:23:01.370 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
INFO | jvm 1 | main | 2016/09/22 15:23:01.371 | at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
INFO | jvm 1 | main | 2016/09/22 15:23:01.372 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
INFO | jvm 1 | main | 2016/09/22 15:23:01.378 | at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
INFO | jvm 1 | main | 2016/09/22 15:23:01.379 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
INFO | jvm 1 | main | 2016/09/22 15:23:01.380 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
INFO | jvm 1 | main | 2016/09/22 15:23:01.383 | at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
INFO | jvm 1 | main | 2016/09/22 15:23:01.391 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
INFO | jvm 1 | main | 2016/09/22 15:23:01.392 | at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)
INFO | jvm 1 | main | 2016/09/22 15:23:01.393 | at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
INFO | jvm 1 | main | 2016/09/22 15:23:01.393 | at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
INFO | jvm 1 | main | 2016/09/22 15:23:01.393 | at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
INFO | jvm 1 | main | 2016/09/22 15:23:01.393 | at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO | jvm 1 | main | 2016/09/22 15:23:01.394 | at com.example.storefront.filters.SiteMinderFilter.doFilter(SiteMinderFilter.java:119)
INFO | jvm 1 | main | 2016/09/22 15:23:01.394 | at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO | jvm 1 | main | 2016/09/22 15:23:01.395 | at com.example.storefront.filters.UrlEncoderFilter.doFilterInternal(UrlEncoderFilter.java:87)
INFO | jvm 1 | main | 2016/09/22 15:23:01.395 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
INFO | jvm 1 | main | 2016/09/22 15:23:01.396 | at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO | jvm 1 | main | 2016/09/22 15:23:01.396 | at com.example.storefront.filters.StorefrontFilter.doFilter(StorefrontFilter.java:74)
INFO | jvm 1 | main | 2016/09/22 15:23:01.396 | at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO | jvm 1 | main | 2016/09/22 15:23:01.397 | at com.example.storefront.filters.cms.CMSSiteFilter.doFilterInternal(CMSSiteFilter.java:100)
INFO | jvm 1 | main | 2016/09/22 15:23:01.397 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
INFO | jvm 1 | main | 2016/09/22 15:23:01.398 | at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO | jvm 1 | main | 2016/09/22 15:23:01.399 | at com.example.storefront.filters.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:89)
INFO | jvm 1 | main | 2016/09/22 15:23:01.399 | at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO | jvm 1 | main | 2016/09/22 15:23:01.399 | at com.example.storefront.filters.AcceleratorAddOnFilter.doFilter(AcceleratorAddOnFilter.java:92)
INFO | jvm 1 | main | 2016/09/22 15:23:01.399 | at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO | jvm 1 | main | 2016/09/22 15:23:01.406 | at de.hybris.platform.servicelayer.web.SessionFilter.doFilter(SessionFilter.java:71)
INFO | jvm 1 | main | 2016/09/22 15:23:01.407 | at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO | jvm 1 | main | 2016/09/22 15:23:01.408 | at de.hybris.platform.servicelayer.web.Log4JFilter.doFilter(Log4JFilter.java:45)
INFO | jvm 1 | main | 2016/09/22 15:23:01.408 | at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:224)
INFO | jvm 1 | main | 2016/09/22 15:23:01.409 | at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.doFilterInternal(AbstractPlatformFilterChain.java:154)
INFO | jvm 1 | main | 2016/09/22 15:23:01.410 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
INFO | jvm 1 | main | 2016/09/22 15:23:01.410 | at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
INFO | jvm 1 | main | 2016/09/22 15:23:01.411 | at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
INFO | jvm 1 | main | 2016/09/22 15:23:01.411 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
INFO | jvm 1 | main | 2016/09/22 15:23:01.412 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
INFO | jvm 1 | main | 2016/09/22 15:23:01.413 | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
INFO | jvm 1 | main | 2016/09/22 15:23:01.413 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
INFO | jvm 1 | main | 2016/09/22 15:23:01.413 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
INFO | jvm 1 | main | 2016/09/22 15:23:01.413 | at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
INFO | jvm 1 | main | 2016/09/22 15:23:01.414 | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
INFO | jvm 1 | main | 2016/09/22 15:23:01.414 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
INFO | jvm 1 | main | 2016/09/22 15:23:01.415 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
INFO | jvm 1 | main | 2016/09/22 15:23:01.415 | at com.example.storefront.filters.AcceleratorAddOnFilter.doFilter(AcceleratorAddOnFilter.java:92)
INFO | jvm 1 | main | 2016/09/22 15:23:01.416 | at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
INFO | jvm 1 | main | 2016/09/22 15:23:01.416 | at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
INFO | jvm 1 | main | 2016/09/22 15:23:01.416 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
INFO | jvm 1 | main | 2016/09/22 15:23:01.417 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
INFO | jvm 1 | main | 2016/09/22 15:23:01.417 | at de.hybris.platform.servicelayer.web.XSSFilter.processPatternsAndDoFilter(XSSFilter.java:293)
INFO | jvm 1 | main | 2016/09/22 15:23:01.419 | at de.hybris.platform.servicelayer.web.XSSFilter.doFilter(XSSFilter.java:247)
INFO | jvm 1 | main | 2016/09/22 15:23:01.419 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
INFO | jvm 1 | main | 2016/09/22 15:23:01.420 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
INFO | jvm 1 | main | 2016/09/22 15:23:01.420 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
INFO | jvm 1 | main | 2016/09/22 15:23:01.423 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
INFO | jvm 1 | main | 2016/09/22 15:23:01.424 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
INFO | jvm 1 | main | 2016/09/22 15:23:01.425 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
INFO | jvm 1 | main | 2016/09/22 15:23:01.426 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
INFO | jvm 1 | main | 2016/09/22 15:23:01.427 | at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
INFO | jvm 1 | main | 2016/09/22 15:23:01.428 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
INFO | jvm 1 | main | 2016/09/22 15:23:01.428 | at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
INFO | jvm 1 | main | 2016/09/22 15:23:01.429 | at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
INFO | jvm 1 | main | 2016/09/22 15:23:01.430 | at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
INFO | jvm 1 | main | 2016/09/22 15:23:01.430 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
INFO | jvm 1 | main | 2016/09/22 15:23:01.431 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
INFO | jvm 1 | main | 2016/09/22 15:23:01.433 | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
INFO | jvm 1 | main | 2016/09/22 15:23:01.448 | at java.lang.Thread.run(Thread.java:745)
I am unable to figure out why this is happening , Any help is greatly appreciated.
I have a single class application
#Configuration
#ComponentScan
public class Main {
public static void main(String[] args) {
SpringApplication.run(Main.class);
}
}
It's works pretty well (doing nothing) with the following dependencies (Ivy notation used)
<dependency org="org.springframework.boot" name="spring-boot-starter" rev="1.1.7.RELEASE"/>
<dependency org="org.springframework" name="spring-context" rev="4.1.0.RELEASE"/>
<dependency org="org.springframework" name="spring-beans" rev="4.1.1.RELEASE"/>
But when I add <dependency org="org.springframework.boot" name="spring-boot" rev="1.1.7.RELEASE"/> I get the following exception.
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:124)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
INFO | jvm 1 | 2014/10/10 17:45:49 | at one.video.streaming.Main.main(Main.java:48)
INFO | jvm 1 | 2014/10/10 17:45:49 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2014/10/10 17:45:49 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO | jvm 1 | 2014/10/10 17:45:49 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 1 | 2014/10/10 17:45:49 | at java.lang.reflect.Method.invoke(Method.java:483)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:136)
INFO | jvm 1 | 2014/10/10 17:45:49 | at java.lang.Thread.run(Thread.java:745)
INFO | jvm 1 | 2014/10/10 17:45:49 | Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:174)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:147)
INFO | jvm 1 | 2014/10/10 17:45:49 | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:121)
INFO | jvm 1 | 2014/10/10 17:45:49 | ... 13 common frames omitted
My goal is not to add spring-boot library, I don't need it, but I want to understand how does Spring work and why it starts to trying to use some web stuff for my app.