Spring Boot fails to start - java

I have a Spring Boot app, which ran fine on my Windows machine, but is now failing to start on my xUbuntu VM running on Virtual Box.
I call it using following command:
java -Djava.net.preferIPv4Stack=true -jar -Xmx1500m highlighter-0.0.1.jar
I added -Djava.net.preferIPv4Stack=true after reading these multiple answers, but it did not solve the issue.
I get following error:
2015-01-28 17:20:02.844 DEBUG 18612 --- [ main] o.s.w.s.resource.ResourceUrlProvider : Looking for resource handler mappings
2015-01-28 17:20:02.845 DEBUG 18612 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'viewControllerHandlerMapping'
2015-01-28 17:20:02.845 DEBUG 18612 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'resourceHandlerMapping'
2015-01-28 17:20:02.845 DEBUG 18612 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'faviconHandlerMapping'
2015-01-28 17:20:02.845 DEBUG 18612 --- [ main] o.s.w.s.resource.ResourceUrlProvider : Found resource handler mapping: URL pattern="/**/favicon.ico", locations=[class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/], class path resource []], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver#2e9e8b52]
2015-01-28 17:20:02.845 DEBUG 18612 --- [ main] o.s.w.s.resource.ResourceUrlProvider : Found resource handler mapping: URL pattern="/webjars/**", locations=[class path resource [META-INF/resources/webjars/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver#6a90f803]
2015-01-28 17:20:02.846 DEBUG 18612 --- [ main] o.s.w.s.resource.ResourceUrlProvider : Found resource handler mapping: URL pattern="/**", locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver#c09fd55]
2015-01-28 17:20:02.847 DEBUG 18612 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Searching for key 'spring.liveBeansView.mbeanDomain' in [servletConfigInitParams]
2015-01-28 17:20:02.847 DEBUG 18612 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Searching for key 'spring.liveBeansView.mbeanDomain' in [servletContextInitParams]
2015-01-28 17:20:02.847 DEBUG 18612 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties]
2015-01-28 17:20:02.847 DEBUG 18612 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment]
2015-01-28 17:20:02.847 DEBUG 18612 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Searching for key 'spring.liveBeansView.mbeanDomain' in [random]
2015-01-28 17:20:02.847 DEBUG 18612 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Searching for key 'spring.liveBeansView.mbeanDomain' in [applicationConfig: [file:./application.properties]]
2015-01-28 17:20:02.847 DEBUG 18612 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
2015-01-28 17:20:02.870 ERROR 18612 --- [ main] o.a.coyote.http11.Http11NioProtocol : Failed to start end point associated with ProtocolHandler ["http-nio-80"]
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.Net.bind(Net.java:428)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:343)
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:737)
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:471)
at org.apache.coyote.http11.Http11NioProtocol.start(Http11NioProtocol.java:80)
at org.apache.catalina.connector.Connector.startInternal(Connector.java:986)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:237)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:186)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:149)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:287)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
at com.dash.nlpHighlight.web.App.main(App.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:745)
2015-01-28 17:20:02.872 ERROR 18612 --- [ main] o.apache.catalina.core.StandardService : Failed to start connector [Connector[HTTP/1.1-80]]
org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-80]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:237)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:186)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:149)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:287)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
at com.dash.nlpHighlight.web.App.main(App.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: service.getName(): "Tomcat"; Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:993)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 18 common frames omitted
Caused by: java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.Net.bind(Net.java:428)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:343)
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:737)
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:471)
at org.apache.coyote.http11.Http11NioProtocol.start(Http11NioProtocol.java:80)
at org.apache.catalina.connector.Connector.startInternal(Connector.java:986)
... 19 common frames omitted
2015-01-28 17:20:02.886 INFO 18612 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat
2015-01-28 17:20:02.911 INFO 18612 --- [ main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-boot-starter-web-1.2.1.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/stanford-corenlp-3.5.0.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/stanford-corenlp-3.5.0-models.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/junit-4.12.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-boot-starter-1.2.1.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-boot-starter-tomcat-1.2.1.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/jackson-databind-2.4.4.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/hibernate-validator-5.1.3.Final.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-core-4.1.4.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-web-4.1.4.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-webmvc-4.1.4.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/xom-1.2.10.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/joda-time-2.1.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/jollyday-0.4.7.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/ejml-0.23.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/javax.json-api-1.0.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/hamcrest-core-1.3.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-boot-1.2.1.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-boot-autoconfigure-1.2.1.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-boot-starter-logging-1.2.1.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/snakeyaml-1.14.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/tomcat-embed-core-8.0.15.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/tomcat-embed-el-8.0.15.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/tomcat-embed-logging-juli-8.0.15.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/tomcat-embed-websocket-8.0.15.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/jackson-annotations-2.4.0.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/jackson-core-2.4.4.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/validation-api-1.1.0.Final.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/jboss-logging-3.1.3.GA.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/classmate-1.0.0.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-aop-4.1.4.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-beans-4.1.4.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-context-4.1.4.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/spring-expression-4.1.4.RELEASE.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/xercesImpl-2.8.0.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/xalan-2.7.0.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/jaxb-api-2.2.7.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/jcl-over-slf4j-1.7.8.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/jul-to-slf4j-1.7.8.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/log4j-over-slf4j-1.7.8.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/logback-classic-1.1.2.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/aopalliance-1.0.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/slf4j-api-1.7.8.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/logback-core-1.1.2.jar!/, jar:file:/home/dash/Dropbox/Projects/NLP/highlighter/build/libs/highlighter-0.0.1.jar!/lib/xml-apis-2.0.2.jar!/]
2015-01-28 17:20:02.913 DEBUG 18612 --- [ main] utoConfigurationReportLoggingInitializer :
=========================
AUTO-CONFIGURATION REPORT
=========================
...
2015-01-28 17:20:02.918 ERROR 18612 --- [ main] o.s.boot.SpringApplication : Application startup failed
java.lang.IllegalStateException: Tomcat connector in failed state
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:157)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:287)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
at com.dash.nlpHighlight.web.App.main(App.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:745)
2015-01-28 17:20:02.919 INFO 18612 --- [ main] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#5b5ba2dc: startup date [Wed Jan 28 17:19:37 EST 2015]; root of context hierarchy
2015-01-28 17:20:02.919 DEBUG 18612 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'lifecycleProcessor'
2015-01-28 17:20:02.920 DEBUG 18612 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#3e1057f5: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,sampleController,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor,org.springframework.boot.autoconfigure.AutoConfigurationPackages,org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration,org.springframework.boot.autoconfigure.condition.BeanTypeRegistry,propertySourcesPlaceholderConfigurer,org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat,tomcatEmbeddedServletContainerFactory,org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration,embeddedServletContainerCustomizerBeanPostProcessor,org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletConfiguration,dispatcherServlet,dispatcherServletRegistration,org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration,org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration,error,beanNameViewResolver,org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration,errorAttributes,basicErrorController,org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration,requestMappingHandlerAdapter,requestMappingHandlerMapping,mvcContentNegotiationManager,viewControllerHandlerMapping,beanNameHandlerMapping,resourceHandlerMapping,mvcResourceUrlProvider,defaultServletHandlerMapping,mvcConversionService,mvcValidator,mvcPathMatcher,mvcUrlPathHelper,mvcUriComponentsContributor,httpRequestHandlerAdapter,simpleControllerHandlerAdapter,handlerExceptionResolver,mvcViewResolver,org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter$FaviconConfiguration,faviconHandlerMapping,faviconRequestHandler,org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter,defaultViewResolver,requestContextListener,viewResolver,spring.mvc.CONFIGURATION_PROPERTIES,spring.resources.CONFIGURATION_PROPERTIES,org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor,org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.store,org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration,hiddenHttpMethodFilter,org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration,jacksonObjectMapperBuilder,http.mappers.CONFIGURATION_PROPERTIES,spring.jackson.CONFIGURATION_PROPERTIES,org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration,jacksonObjectMapper,org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration,org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration$StringHttpMessageConverterConfiguration,stringHttpMessageConverter,spring.http.encoding.CONFIGURATION_PROPERTIES,org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration$MappingJackson2HttpMessageConverterConfiguration,mappingJackson2HttpMessageConverter,org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration,messageConverters,org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration,mbeanExporter,objectNamingStrategy,mbeanServer,org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration,characterEncodingFilter,org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration,multipartConfigElement,multipartResolver,multipart.CONFIGURATION_PROPERTIES,org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration,serverProperties]; root of factory hierarchy
2015-01-28 17:20:02.922 DEBUG 18612 --- [ main] o.s.b.f.support.DisposableBeanAdapter : Invoking destroy() on bean with name 'mbeanExporter'
2015-01-28 17:20:02.922 INFO 18612 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2015-01-28 17:20:02.923 DEBUG 18612 --- [ main] o.s.b.f.support.DisposableBeanAdapter : Invoking destroy() on bean with name 'mvcValidator'
2015-01-28 17:20:02.924 DEBUG 18612 --- [ main] o.s.b.f.support.DisposableBeanAdapter : Invoking destroy() on bean with name 'characterEncodingFilter'
2015-01-28 17:20:02.924 DEBUG 18612 --- [ main] o.s.b.f.support.DisposableBeanAdapter : Invoking destroy() on bean with name 'hiddenHttpMethodFilter'
2015-01-28 17:20:02.924 DEBUG 18612 --- [ main] o.s.b.f.support.DisposableBeanAdapter : Invoking destroy() on bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor'
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:157)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:287)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
at com.dash.nlpHighlight.web.App.main(App.java:16)
... 6 more

I found the answer here:
According to w3.org doc ports below 1024 are priviledged on Linux. Only root can bind to such ports.
You should either use ports >1024 or run under root account (not recommended).
The solution is to set different port in "application.properties" file, e.g. server.port=${port:8181} or to run as root using sudo (not recommended).

sometimes you can get same error on cloud env like openshift, cause localhost is not allowed there, you need also specify IP while starting app with param
--server.address=$OPENSHIFT_DIY_IP

In java API Class to add
System.setProperty("java.net.preferIPv4Stack", "true");
this line.

Change the listening port to 8181
java -Djava.net.preferIPv4Stack=true -jar -Xmx1500m highlighter-0.0.1.jar -Dserver.port=8181
Port numbers have a range of 0..65535 (although often 0 has special meaning). In the original BSD TCP implementation, only root can bind to ports 1..1023, and dynamically assigned ports were assigned from the range 1024..5000.

Related

Problems with launch spring boot jar on ubuntu server. Error starting ApplicationContext

I have configured nginx to fit my code. My code works well on Windows and now I'm trying to deploy it to Ubuntu. I run jar and it fail. Logs:
:: Spring Boot :: (v2.4.2)
2021-03-13 06:52:55.131 INFO 4305 --- [ main] com.social.socialmedia.Application : Starting Application v1.0-SNAPSHOT using Java 1.8.0_282 o
n amber with PID 4305 (/home/kirill/social-media-1.0-SNAPSHOT.jar started by kirill in /home/kirill)
2021-03-13 06:52:55.149 INFO 4305 --- [ main] com.social.socialmedia.Application : No active profile set, falling back to default profiles:
default
2021-03-13 06:53:00.135 INFO 4305 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mod
e.
2021-03-13 06:53:00.515 INFO 4305 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 332 ms. Found
2 JPA repository interfaces.
2021-03-13 06:53:03.824 INFO 4305 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.meth
od.DefaultMethodSecurityExpressionHandler#1fb700ee' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is
not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-03-13 06:53:03.861 INFO 4305 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springfr
amework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not elig
ible for auto-proxying)
2021-03-13 06:53:06.121 INFO 4305 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 80 (http)
2021-03-13 06:53:06.194 INFO 4305 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-03-13 06:53:06.195 INFO 4305 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.41]
2021-03-13 06:53:06.517 INFO 4305 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-03-13 06:53:06.518 INFO 4305 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1
1035 ms
2021-03-13 06:53:08.111 INFO 4305 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-03-13 06:53:08.596 INFO 4305 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.27.Final
2021-03-13 06:53:09.579 INFO 4305 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-03-13 06:53:10.113 INFO 4305 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-03-13 06:53:11.762 INFO 4305 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-03-13 06:53:12.004 INFO 4305 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQ
LDialect
2021-03-13 06:53:19.889 INFO 4305 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hiberna
te.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-03-13 06:53:19.925 INFO 4305 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit
'default'
2021-03-13 06:53:22.331 WARN 4305 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore,
database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-03-13 06:53:27.076 INFO 4305 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.securit
y.web.context.request.async.WebAsyncManagerIntegrationFilter#2364305a, org.springframework.security.web.context.SecurityContextPersistenceFilter#72445aba, or
g.springframework.security.web.header.HeaderWriterFilter#7829b776, org.springframework.security.web.csrf.CsrfFilter#4b3c354a, org.springframework.security.we
b.authentication.logout.LogoutFilter#56f6d40b, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#5536379e, org.springframe
work.security.web.savedrequest.RequestCacheAwareFilter#1c80e49b, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#15c25153
, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#470a696f, org.springframework.security.web.session.SessionManagementFilter#5b
64c4b7, org.springframework.security.web.access.ExceptionTranslationFilter#1433046b, org.springframework.security.web.access.intercept.FilterSecurityIntercep
tor#350ec41e]
2021-03-13 06:53:28.106 INFO 4305 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-03-13 06:53:30.531 WARN 4305 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - can
celling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springfr
amework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
2021-03-13 06:53:30.543 INFO 4305 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-03-13 06:53:30.553 INFO 4305 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'de
fault'
2021-03-13 06:53:30.568 INFO 4305 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-03-13 06:53:30.612 INFO 4305 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2021-03-13 06:53:30.622 INFO 4305 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-03-13 06:53:30.751 INFO 4305 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-03-13 06:53:30.885 ERROR 4305 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.W
ebServerException: Unable to start embedded Tomcat server
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.3.jar!/:5.3.3]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.3.jar!/:5.3.3]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.3.jar!
/:5.3.3]
at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_282]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.3.jar!/:5.3.3]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.3.jar!/:5.3.3]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:940) ~[spring-context-5.3.3.jar!/:5.3
.3]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591) ~[spring-context-5.3.3.jar!/:5.3.3]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot
-2.4.2.jar!/:2.4.2]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) [spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) [spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) [spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311) [spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) [spring-boot-2.4.2.jar!/:2.4.2]
at com.social.socialmedia.Application.main(Application.java:10) [classes!/:1.0-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_282]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_282]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_282]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_282]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [social-media-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:107) [social-media-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [social-media-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) [social-media-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:229) ~[spring-boot-2.4.2.jar!/:2.4.2]
at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43) ~[spring-boot-2.4.2.jar!/:2.4.
2]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.3.jar!/:5.3.3]
... 23 common frames omitted
Caused by: java.lang.IllegalArgumentException: standardService.connector.startFailed
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:244) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:282) ~[spring-boot-2.4.2.jar!/:2.
4.2]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:213) ~[spring-boot-2.4.2.jar!/:2.4.2]
... 25 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1067) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:240) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
... 27 common frames omitted
Caused by: java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_282]
at sun.nio.ch.Net.bind(Net.java:461) ~[na:1.8.0_282]
at sun.nio.ch.Net.bind(Net.java:453) ~[na:1.8.0_282]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222) ~[na:1.8.0_282]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:85) ~[na:1.8.0_282]
at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:228) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:211) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1159) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1245) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:603) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1064) ~[tomcat-embed-core-9.0.41.jar!/:9.0.41]
... 29 common frames comitte
My propeties:
spring.datasource.url=jdbc:postgresql://localhost:5432/socialmedia
spring.datasource.username=postgres
spring.datasource.password=root
spring.jpa.generate-ddl=false
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=validate
spring.flyway.enabled=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
continues code:
upload.path=home/kirill/uploads
#properties for MailSender
#smptps - Not secure connection
spring.mail.host=smtp.yandex.ru
#test
spring.mail.username= HIDED EMAIL
spring.mail.password=password
spring.mail.port=465
spring.mail.protocol=smtps
mail.debug=false
recaptcha.secret=hided secret
spring.session.jdbc.initialize-schema=always
spring.session.jdbc.table-name=SPRING_SESSION
hostname= HIDED HOST
server.port=80
Everywhere I looked for solutions, I did not find anything. I don't understand this error
You are trying to run the application on port 80.
server.port=80
Ports < 1024 are only allowed to run as root.
Either run it as root (not recommended) or use another port.

Failed to start bean 'webServerStartStop'; Unable to start embedded Tomcat server - spring-boot-starter-web

Spring application using Maven including only Spring Web dependency gives "Unable to start embedded Tomcat serve" error.
The same project runs on other computers like expected.
Spring Boot Version: 2.4.3
Package Type: JAR
Java Version: 11
No additional code added from the starter project except to print to the console for testing.
Application runs and prints to the console like expected when tomcat is excluded int the pom.xml.
Tested multiple ports.
Tested JDK 8 and 11.
pom.xml dependancies:
<dependencies>
<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>
</dependencies>
Log:
2021-02-22 16:17:28.896 INFO 34556 --- [ main] com.example.demo.DemoApplication : Starting DemoApplication using Java 11.0.10 on Soul with PID 34556 (C:\Users\ryne0\Desktop\FullStackWeb\Spring\demo\target\classes started by ryne0 in C:\Users\ryne0\Desktop\FullStackWeb\Spring\demo)
2021-02-22 16:17:28.900 INFO 34556 --- [ main] com.example.demo.DemoApplication : No active profile set, falling back to default profiles: default
2021-02-22 16:17:28.902 DEBUG 34556 --- [ main] o.s.boot.SpringApplication : Loading source class com.example.demo.DemoApplication
2021-02-22 16:17:28.995 DEBUG 34556 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#457c9034
2021-02-22 16:17:30.317 DEBUG 34556 --- [ main] .s.b.w.e.t.TomcatServletWebServerFactory : Code archive: C:\Users\ryne0\.m2\repository\org\springframework\boot\spring-boot\2.4.3\spring-boot-2.4.3.jar
2021-02-22 16:17:30.318 DEBUG 34556 --- [ main] .s.b.w.e.t.TomcatServletWebServerFactory : Code archive: C:\Users\ryne0\.m2\repository\org\springframework\boot\spring-boot\2.4.3\spring-boot-2.4.3.jar
2021-02-22 16:17:30.318 DEBUG 34556 --- [ main] .s.b.w.e.t.TomcatServletWebServerFactory : None of the document roots [src/main/webapp, public, static] point to a directory and will be ignored.
2021-02-22 16:17:30.353 INFO 34556 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 81 (http)
2021-02-22 16:17:30.374 INFO 34556 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-02-22 16:17:30.387 INFO 34556 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.43]
2021-02-22 16:17:30.507 INFO 34556 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-02-22 16:17:30.507 DEBUG 34556 --- [ main] w.s.c.ServletWebServerApplicationContext : Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]
2021-02-22 16:17:30.508 INFO 34556 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1513 ms
2021-02-22 16:17:30.535 DEBUG 34556 --- [ main] o.s.b.w.s.ServletContextInitializerBeans : Mapping filters: characterEncodingFilter urls=[/*] order=-2147483648, formContentFilter urls=[/*] order=-9900, requestContextFilter urls=[/*] order=-105
2021-02-22 16:17:30.547 DEBUG 34556 --- [ main] o.s.b.w.s.ServletContextInitializerBeans : Mapping servlets: dispatcherServlet urls=[/]
2021-02-22 16:17:30.599 DEBUG 34556 --- [ main] o.s.b.w.s.f.OrderedRequestContextFilter : Filter 'requestContextFilter' configured for use
2021-02-22 16:17:30.600 DEBUG 34556 --- [ main] s.b.w.s.f.OrderedCharacterEncodingFilter : Filter 'characterEncodingFilter' configured for use
2021-02-22 16:17:30.600 DEBUG 34556 --- [ main] o.s.b.w.s.f.OrderedFormContentFilter : Filter 'formContentFilter' configured for use
2021-02-22 16:17:30.817 INFO 34556 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-02-22 16:17:30.828 DEBUG 34556 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : ControllerAdvice beans: 0 #ModelAttribute, 0 #InitBinder, 1 RequestBodyAdvice, 1 ResponseBodyAdvice
2021-02-22 16:17:30.949 DEBUG 34556 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : 2 mappings in 'requestMappingHandlerMapping'
2021-02-22 16:17:30.991 DEBUG 34556 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Patterns [/webjars/**, /**] in 'resourceHandlerMapping'
2021-02-22 16:17:31.003 DEBUG 34556 --- [ main] .m.m.a.ExceptionHandlerExceptionResolver : ControllerAdvice beans: 0 #ExceptionHandler, 1 ResponseBodyAdvice
2021-02-22 16:17:31.104 WARN 34556 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
2021-02-22 16:17:31.110 INFO 34556 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-02-22 16:17:31.122 INFO 34556 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-02-22 16:17:31.197 DEBUG 34556 --- [ main] ConditionEvaluationReportLoggingListener :
2021-02-22 16:17:32.117 ERROR 34556 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.4.jar:5.3.4]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.4.jar:5.3.4]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.4.jar:5.3.4]
at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.4.jar:5.3.4]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.4.jar:5.3.4]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:934) ~[spring-context-5.3.4.jar:5.3.4]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:585) ~[spring-context-5.3.4.jar:5.3.4]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) ~[spring-boot-2.4.3.jar:2.4.3]
at com.example.demo.DemoApplication.main(DemoApplication.java:10) ~[classes/:na]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:229) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.4.jar:5.3.4]
... 15 common frames omitted
Caused by: java.lang.IllegalArgumentException: standardService.connector.startFailed
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:244) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:282) ~[spring-boot-2.4.3.jar:2.4.3]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:213) ~[spring-boot-2.4.3.jar:2.4.3]
... 17 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1074) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:240) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
... 19 common frames omitted
Caused by: java.io.IOException: Unable to establish loopback connection
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:94) ~[na:na]
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:61) ~[na:na]
at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
at java.base/sun.nio.ch.PipeImpl.<init>(PipeImpl.java:171) ~[na:na]
at java.base/sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50) ~[na:na]
at java.base/java.nio.channels.Pipe.open(Pipe.java:155) ~[na:na]
at java.base/sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:142) ~[na:na]
at java.base/sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:44) ~[na:na]
at java.base/java.nio.channels.Selector.open(Selector.java:295) ~[na:na]
at org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector(NioSelectorPool.java:52) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
at org.apache.tomcat.util.net.NioSelectorPool.close(NioSelectorPool.java:119) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:386) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1198) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1279) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:608) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1071) ~[tomcat-embed-core-9.0.43.jar:9.0.43]
... 21 common frames omitted
Caused by: java.net.BindException: Cannot assign requested address: connect
at java.base/sun.nio.ch.Net.connect0(Native Method) ~[na:na]
at java.base/sun.nio.ch.Net.connect(Net.java:476) ~[na:na]
at java.base/sun.nio.ch.Net.connect(Net.java:468) ~[na:na]
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:694) ~[na:na]
at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:194) ~[na:na]
at java.base/sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:127) ~[na:na]
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:76) ~[na:na]
... 36 common frames omitted
There was control software installed for the individuals Network interface controller (NIC) that allowed both ethernet and wifi to be used simultaneously. This was installed to supposedly improve gaming experience, but did not play nicely with tomcat in Spring. Once disabled the application was able to run as expected.
Edit:
A similar error occurs if your address or port is incorrect / already used. This fixes the error in most situations, but a driver like the one mentioned above may cause the error.
It got fixed for me after changing server.port to 8080 from 80.
I was trying to run spring boot on my local network and that error occurred.
The problem was a wrongly specified IP address property inside my application-dev.yml file.
server:
address: 192.168.0.107 // it needed to be 192.168.0.104
port: 8080
You can always check your IPv4 Address by running ipconfig.
Disable the Gamingservices service or go to the task manager and end the task of gamingservices and run again the application. or restart the computer.

Spring Boot 2.3 fails to start when spring.jpa.hibernate.ddl-auto equals to validate

I have a Spring boot: 2.3.0.RELEASE application with Flyway: 6.4.1 and Hibernate: hibernate-core: 5.4.22.Final, hibernate-validator: 6.1.5.Final, hibernate-commons-annotations: 5.1.0.Final.
I tried searching for errors but cannot find a solution. I tried applying this answer, but whenever spring.jpa.hibernate.ddl-auto=validate is set, it doesn't work if I use none, drop-create value everything back to the norm.
I run MySQL 5.7 in Docker, and the database with tables is there.
The error is below:
ConfigServletWebServerApplicationContext : Exception encountered
during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'requestMappingHandlerAdapter' defined
in class path resource
[org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]:
Unsatisfied dependency expressed through method
'requestMappingHandlerAdapter' parameter 1; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'mvcConversionService' defined in class path
resource
[org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.format.support.FormattingConversionService]:
Factory method 'mvcConversionService' threw exception; nested
exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'customerRepository' defined in
org.cloudwheel.files.configuration.customer.persistence.CustomerRepository
defined in #EnableJpaRepositories declared on
JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Cannot
resolve reference to bean 'jpaMappingContext' while setting bean
property 'mappingContext'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'jpaMappingContext': Invocation of init method
failed; nested exception is javax.persistence.PersistenceException:
[PersistenceUnit: default] Unable to build Hibernate SessionFactory;
nested exception is
org.hibernate.tool.schema.spi.SchemaManagementException:
Schema-validation: missing table [my_files]
How can I debug this? I see many such issues, but none of the solutions worked for me.
NOTE: The table my_files is present. I can verify this both via IntelliJ and MySQL Workbench. Also, I don't want to downgrade if possible.
UPDATE:
I am sure that a database isn't a problem:
2020-12-01 14:24:04.795 INFO 23295 --- [ restartedMain]
o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with
port(s): 8080 (http) 2020-12-01 14:24:04.800 INFO 23295 --- [
restartedMain] o.apache.catalina.core.StandardService : Starting
service [Tomcat] 2020-12-01 14:24:04.800 INFO 23295 --- [
restartedMain] org.apache.catalina.core.StandardEngine : Starting
Servlet engine: [Apache Tomcat/9.0.35] 2020-12-01 14:24:04.895 INFO
23295 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] :
Initializing Spring embedded WebApplicationContext 2020-12-01
14:24:04.895 INFO 23295 --- [ restartedMain]
o.s.web.context.ContextLoader : Root WebApplicationContext:
initialization completed in 1762 ms 2020-12-01 14:24:07.982 INFO
23295 --- [ restartedMain] o.f.c.internal.license.VersionPrinter :
Flyway Community Edition 6.4.1 by Redgate 2020-12-01 14:24:07.986
INFO 23295 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource
: HikariPool-1 - Starting... 2020-12-01 14:24:08.090 INFO 23295 --- [
restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1
Start completed. 2020-12-01 14:24:08.113 INFO 23295 --- [ restartedMain] o.f.c.internal.database.DatabaseFactory : Database:
jdbc:mysql://localhost:3307/files (MySQL 5.7) 2020-12-01 14:24:08.186
INFO 23295 --- [ restartedMain] o.f.core.internal.command.DbValidate
: Successfully validated 13 migrations (execution time 00:00.029s)
2020-12-01 14:24:08.199 INFO 23295 --- [ restartedMain]
o.f.core.internal.command.DbMigrate : Current version of schema
files: 1.13 2020-12-01 14:24:08.200 INFO 23295 --- [
restartedMain] o.f.core.internal.command.DbMigrate : Schema
files is up to date. No migration necessary. 2020-12-01
14:24:08.268 INFO 23295 --- [ restartedMain]
o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing
ExecutorService 'applicationTaskExecutor' 2020-12-01 14:24:08.281
INFO 23295 --- [ restartedMain] o.s.s.c.ThreadPoolTaskScheduler
: Initializing ExecutorService 'taskScheduler' 2020-12-01 14:24:08.330
INFO 23295 --- [ task-1]
o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing
PersistenceUnitInfo [name: default] 2020-12-01 14:24:08.374 INFO
23295 --- [ task-1] org.hibernate.Version :
HHH000412: Hibernate ORM core version 5.4.22.Final
The exception says org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [my_files].
You say that the database my_files is present, but hibernate needs a table my_files to be present - for example you used annotation #Table(name = "my_files") or you have entity with name MyFiles.
Check whether the database contains the table my_files.
As #M.Deinum mentioned in his comments Flyway and Hibernate might not have been connected to the same datasource. In my case, it was because of hibernate.temp.use_jdbc_metadata_defaults=true. As soon as I removed this property, everything started working.

Spring Boot HIbernate Issue: Error executing DDL via JDBC Statement with ddl-auto=create-drop

I am a novice with Spring and Hibernate and have tried everything I could find to fix this with no luck. Any assistance would be greatly appreciated. I am currently following a sample project in a book, and am getting an error that says "GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement." I am using a MariaDB database, and my hibernate dialect is org.hibernate.dialect.MySQL5InnoDBDialect.
The query causing this issue is
alter table car drop foreign key FK2mqqwvxtowv4vddvtsmvtiqa2;
If I try to run this query directly in the database it works fine. I have the ddl-auto property set to create-drop, so maybe it is trying to execute this query when the car table has been dropped and is not there? I'm not sure why it would do that or how to turn off this behavior if that is the problem.
If I change ddl-auto to validate or update, the application fails to run at all. If I change it to create, it works fine and I get no errors.
With create-drop, the application does connect to the database and all my tables are created. The tables are still defined as they should be, but the error remains.
Console output:
2018-07-25 16:56:24.229 INFO 12414 --- [ restartedMain] c.p.cardatabase.CardatabaseApplication : Starting CardatabaseApplication on Northstar-2.local with PID 12414 2018-07-25 16:56:24.230 INFO 12414 --- [ restartedMain] c.p.cardatabase.CardatabaseApplication : No active profile set, falling back to default profiles: default
2018-07-25 16:56:24.278 INFO 12414 --- [ restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#42e3f007: startup date [Wed Jul 25 16:56:24 AKDT 2018]; root of context hierarchy
2018-07-25 16:56:25.134 INFO 12414 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'httpRequestHandlerAdapter' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration; factoryMethodName=httpRequestHandlerAdapter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; factoryMethodName=httpRequestHandlerAdapter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]]
2018-07-25 16:56:25.535 INFO 12414 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$e5303d26] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-07-25 16:56:25.850 INFO 12414 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-07-25 16:56:25.875 INFO 12414 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-07-25 16:56:25.875 INFO 12414 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.29
2018-07-25 16:56:25.883 INFO 12414 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/tatiana/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2018-07-25 16:56:26.025 INFO 12414 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-07-25 16:56:26.025 INFO 12414 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1750 ms
2018-07-25 16:56:26.155 INFO 12414 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-07-25 16:56:26.156 INFO 12414 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-07-25 16:56:26.156 INFO 12414 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-07-25 16:56:26.156 INFO 12414 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-07-25 16:56:26.156 INFO 12414 --- [ost-startStop-1] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2018-07-25 16:56:26.156 INFO 12414 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-07-25 16:56:26.288 INFO 12414 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2018-07-25 16:56:26.354 INFO 12414 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2018-07-25 16:56:26.385 INFO 12414 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2018-07-25 16:56:26.401 INFO 12414 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2018-07-25 16:56:26.467 INFO 12414 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate Core {5.2.16.Final}
2018-07-25 16:56:26.469 INFO 12414 --- [ restartedMain] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2018-07-25 16:56:26.504 INFO 12414 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-07-25 16:56:26.602 INFO 12414 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
2018-07-25 16:56:27.062 WARN 12414 --- [ restartedMain] o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL via JDBC Statement
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) ~[hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlString(SchemaDropperImpl.java:375) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlStrings(SchemaDropperImpl.java:359) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.applyConstraintDropping(SchemaDropperImpl.java:331) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropFromMetadata(SchemaDropperImpl.java:230) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.performDrop(SchemaDropperImpl.java:154) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:126) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:112) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:144) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:312) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:460) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:892) [hibernate-core-5.2.16.Final.jar:5.2.16.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) [spring-orm-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) [spring-orm-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390) [spring-orm-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377) [spring-orm-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) [spring-orm-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1761) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1698) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1089) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:859) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at com.packt.cardatabase.CardatabaseApplication.main(CardatabaseApplication.java:28) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.0.1.RELEASE.jar:2.0.1.RELEASE]
Caused by: java.sql.SQLSyntaxErrorException: (conn=342) Table 'cardb.car' doesn't exist
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:177) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:110) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:228) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:334) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:386) ~[mariadb-java-client-2.2.3.jar:na]
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95) ~[HikariCP-2.7.8.jar:na]
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-2.7.8.jar:na]
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ~[hibernate-core-5.2.16.Final.jar:5.2.16.Final]
... 40 common frames omitted
Caused by: java.sql.SQLException: Table 'cardb.car' doesn't exist
Query is: alter table car drop foreign key FK2mqqwvxtowv4vddvtsmvtiqa2
at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:119) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:199) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:328) ~[mariadb-java-client-2.2.3.jar:na]
... 44 common frames omitted
[ . . . Mapping details here, omitted]
2018-07-25 16:56:27.118 INFO 12414 --- [ restartedMain] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl#23352c6f'
2018-07-25 16:56:27.121 INFO 12414 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2018-07-25 16:56:28.047 INFO 12414 --- [ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher#1, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#7ec73b7e, org.springframework.security.web.context.SecurityContextPersistenceFilter#6f233313, org.springframework.security.web.header.HeaderWriterFilter#1e641fa3, org.springframework.security.web.csrf.CsrfFilter#7c5a0312, org.springframework.security.web.authentication.logout.LogoutFilter#176619be, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#26add7c1, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#4030f929, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#2ea06fad, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#6ce594ae, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#6159e3c1, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#51157300, org.springframework.security.web.session.SessionManagementFilter#5be9c504, org.springframework.security.web.access.ExceptionTranslationFilter#4506e3d3, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#1f44843c]
org.springframework.http.HttpEntity<org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.ProfileController.listAllFormsOfMetadata()
2018-07-25 16:56:28.632 INFO 12414 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-07-25 16:56:28.668 INFO 12414 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-07-25 16:56:28.670 INFO 12414 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'dataSource' has been autodetected for JMX exposure
2018-07-25 16:56:28.676 INFO 12414 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource]
2018-07-25 16:56:28.712 INFO 12414 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-07-25 16:56:28.715 INFO 12414 --- [ restartedMain] c.p.cardatabase.CardatabaseApplication : Started CardatabaseApplication in 4.726 seconds (JVM running for 5.165)
Here is the code on my repo:
https://github.com/Kallaste/spring_login_server_example_so
I wouldn’t worry about it if your application still runs. Hibernate throws a lot of ‘informative’ errors on startup. It just tries to figure out what it has to do to get the database in a state where your application can run.
If the app runs fine if you use create-drop or just create, then try running it with create just once so everything is generated and then change it to validate so the next time it only validates your database schema.
In a production environment you would generally not let Hibernate update the database schema by itself but manually apply changes and migrate data anyway, unless you’re very sure the changes would be applied correctly.
You should use create the first time you run your application, but the next runs have to have update.
When you use create you create the schema and destroy the previous data.
And create-drop destroy the schema in the end of the session. update only update you schema.
update should still be valid. If tables don't exist, it will behave as create.
Are you sure your DB and DBDialect match?
Add #Table annotation like below
#Table(name="car") in car entity. Always give name to table .
Note:
1) When ddl-auto=create-drop and if you don't have #Table(name="car") always you will get this exception.
2) When ddl-auto=create-drop and if you have #Table(name="car") the first time alone you will get this exception.
So try to change the ddl-auto value to other than create-drop . May be you can use "create" or "update"
Hope this helps.
Need to change spring.jpa.hibernate.ddl-auto =update instead of create-drop in application.properties file. Because It is dropping the database at the start of the application and so it won't find the required events table to alter anything.
The problem is because you don't have permissions on the database user.

Spring boot data source initialization error

2016-08-10 11:51:29.938 INFO 4336 --- [ main] com.employee.EmployeeApplication : No active profile set, falling back to default profiles: default
2016-08-10 11:51:29.938 DEBUG 4336 --- [ main] o.s.boot.SpringApplication : Loading source class com.employee.EmployeeApplication
2016-08-10 11:51:29.961 DEBUG 4336 --- [ main] o.s.b.c.c.ConfigFileApplicationListener : Loaded config file 'classpath:/application.yml'
2016-08-10 11:51:29.961 DEBUG 4336 --- [ main] o.s.b.c.c.ConfigFileApplicationListener : Loaded config file 'classpath:/application.yml' for profile default
2016-08-10 11:51:29.961 INFO 4336 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#17486b3: startup date [Wed Aug 10 11:51:29 IST 2016]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#1cabb2a
2016-08-10 11:51:29.970 DEBUG 4336 --- [ main] ationConfigEmbeddedWebApplicationContext : Bean factory for org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#17486b3: org.springframework.beans.factory.support.DefaultListableBeanFactory#30646a: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,employeeApplication]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory#70f8a6
2016-08-10 11:51:41.990 DEBUG 4336 --- [ main] o.s.b.a.AutoConfigurationPackages : #EnableAutoConfiguration was declared on a class in the package 'com.employee'. Automatic #Repository and #Entity scanning is enabled.
2016-08-10 11:51:42.472 WARN 4336 --- [ main] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance #Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static #Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2016-08-10 11:51:42.785 INFO 4336 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=d17d6c85-cdf2-3621-87fd-0420958f449a
2016-08-10 11:51:42.808 INFO 4336 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2016-08-10 11:51:43.091 INFO 4336 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$12e0b249] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-08-10 11:51:43.233 INFO 4336 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$2efab546] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-08-10 11:51:43.247 INFO 4336 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.RefreshEndpointAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.RefreshEndpointAutoConfiguration$$EnhancerBySpringCGLIB$$d859b73c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-08-10 11:51:43.261 DEBUG 4336 --- [ main] ationConfigEmbeddedWebApplicationContext : Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource#e64760]
2016-08-10 11:51:43.261 DEBUG 4336 --- [ main] ationConfigEmbeddedWebApplicationContext : Using ApplicationEventMulticaster [org.springframework.context.event.SimpleApplicationEventMulticaster#5fd2b1]
2016-08-10 11:51:44.354 DEBUG 4336 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Code archive: C:\Users\Shadab%20Ahmed\.m2\repository\org\springframework\boot\spring-boot\1.3.6.RELEASE\spring-boot-1.3.6.RELEASE.jar
2016-08-10 11:51:44.354 DEBUG 4336 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Code archive: C:\Users\Shadab%20Ahmed\.m2\repository\org\springframework\boot\spring-boot\1.3.6.RELEASE\spring-boot-1.3.6.RELEASE.jar
2016-08-10 11:51:44.356 DEBUG 4336 --- [ main] .t.TomcatEmbeddedServletContainerFactory : None of the document roots [src/main/webapp, public, static] point to a directory and will be ignored.
2016-08-10 11:51:44.544 INFO 4336 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8091 (http)
2016-08-10 11:51:44.579 INFO 4336 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-08-10 11:51:44.583 INFO 4336 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.0.36
2016-08-10 11:51:45.030 INFO 4336 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-08-10 11:51:45.031 INFO 4336 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 15070 ms
2016-08-10 11:51:45.232 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.e.ServletContextInitializerBeans : Added existing Servlet initializer bean 'dispatcherServletRegistration'; order=2147483647, resource=class path resource [org/springframework/boot/autoconfigure/web/DispatcherServletAutoConfiguration$DispatcherServletConfiguration.class]
2016-08-10 11:51:46.114 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.e.ServletContextInitializerBeans : Created Filter initializer for bean 'metricFilter'; order=-2147483648, resource=class path resource [org/springframework/boot/actuate/autoconfigure/MetricFilterAutoConfiguration.class]
2016-08-10 11:51:46.114 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.e.ServletContextInitializerBeans : Created Filter initializer for bean 'characterEncodingFilter'; order=-2147483648, resource=class path resource [org/springframework/boot/autoconfigure/web/HttpEncodingAutoConfiguration.class]
2016-08-10 11:51:46.114 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.e.ServletContextInitializerBeans : Created Filter initializer for bean 'hiddenHttpMethodFilter'; order=-10000, resource=class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.class]
2016-08-10 11:51:46.114 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.e.ServletContextInitializerBeans : Created Filter initializer for bean 'httpPutFormContentFilter'; order=-9900, resource=class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.class]
2016-08-10 11:51:46.114 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.e.ServletContextInitializerBeans : Created Filter initializer for bean 'requestContextFilter'; order=-105, resource=class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]
2016-08-10 11:51:46.114 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.e.ServletContextInitializerBeans : Created Filter initializer for bean 'webRequestLoggingFilter'; order=2147483637, resource=class path resource [org/springframework/boot/actuate/autoconfigure/TraceWebFilterAutoConfiguration.class]
2016-08-10 11:51:46.114 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.e.ServletContextInitializerBeans : Created Filter initializer for bean 'applicationContextIdFilter'; order=2147483647, resource=class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration$ApplicationContextFilterConfiguration.class]
2016-08-10 11:51:46.127 INFO 4336 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2016-08-10 11:51:46.142 INFO 4336 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'metricFilter' to: [/*]
2016-08-10 11:51:46.143 INFO 4336 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-08-10 11:51:46.143 INFO 4336 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-08-10 11:51:46.143 INFO 4336 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-08-10 11:51:46.143 INFO 4336 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2016-08-10 11:51:46.143 INFO 4336 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'webRequestLoggingFilter' to: [/*]
2016-08-10 11:51:46.143 INFO 4336 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'applicationContextIdFilter' to: [/*]
2016-08-10 11:51:46.225 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.web.OrderedRequestContextFilter : Initializing filter 'requestContextFilter'
2016-08-10 11:51:46.229 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.web.OrderedRequestContextFilter : Filter 'requestContextFilter' configured successfully
2016-08-10 11:51:46.230 DEBUG 4336 --- [ost-startStop-1] iguration$ApplicationContextHeaderFilter : Initializing filter 'applicationContextIdFilter'
2016-08-10 11:51:46.230 DEBUG 4336 --- [ost-startStop-1] iguration$ApplicationContextHeaderFilter : Filter 'applicationContextIdFilter' configured successfully
2016-08-10 11:51:46.231 DEBUG 4336 --- [ost-startStop-1] .s.b.c.w.OrderedHttpPutFormContentFilter : Initializing filter 'httpPutFormContentFilter'
2016-08-10 11:51:46.231 DEBUG 4336 --- [ost-startStop-1] .s.b.c.w.OrderedHttpPutFormContentFilter : Filter 'httpPutFormContentFilter' configured successfully
2016-08-10 11:51:46.231 DEBUG 4336 --- [ost-startStop-1] o.s.b.a.autoconfigure.MetricsFilter : Initializing filter 'metricFilter'
2016-08-10 11:51:46.231 DEBUG 4336 --- [ost-startStop-1] o.s.b.a.autoconfigure.MetricsFilter : Filter 'metricFilter' configured successfully
2016-08-10 11:51:46.231 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.w.OrderedHiddenHttpMethodFilter : Initializing filter 'hiddenHttpMethodFilter'
2016-08-10 11:51:46.231 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.w.OrderedHiddenHttpMethodFilter : Filter 'hiddenHttpMethodFilter' configured successfully
2016-08-10 11:51:46.231 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.w.OrderedCharacterEncodingFilter : Initializing filter 'characterEncodingFilter'
2016-08-10 11:51:46.231 DEBUG 4336 --- [ost-startStop-1] o.s.b.c.w.OrderedCharacterEncodingFilter : Filter 'characterEncodingFilter' configured successfully
2016-08-10 11:51:46.231 DEBUG 4336 --- [ost-startStop-1] o.s.b.a.trace.WebRequestTraceFilter : Initializing filter 'webRequestLoggingFilter'
2016-08-10 11:51:46.231 DEBUG 4336 --- [ost-startStop-1] o.s.b.a.trace.WebRequestTraceFilter : Filter 'webRequestLoggingFilter' configured successfully
2016-08-10 11:51:46.338 WARN 4336 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$NonEmbeddedConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
2016-08-10 11:51:46.532 INFO 4336 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat
2016-08-10 11:51:46.734 ERROR 4336 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$NonEmbeddedConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:368) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1054) ~[spring-context-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:829) ~[spring-context-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) ~[spring-context-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:760) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:360) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174) [spring-boot-1.3.6.RELEASE.jar:1.3.6.RELEASE]
at com.employee.EmployeeApplication.main(EmployeeApplication.java:11) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$NonEmbeddedConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
... 26 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$NonEmbeddedConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
... 28 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
... 40 common frames omitted
Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.getDriverClassName(DataSourceProperties.java:180) ~[spring-boot-autoconfigure-1.3.6.RELEASE.jar:1.3.6.RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedConfiguration.dataSource(DataSourceAutoConfiguration.java:121) ~[spring-boot-autoconfigure-1.3.6.RELEASE.jar:1.3.6.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_11]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_11]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
... 41 common frames omitted
Application.yml file content is
server:
port:
8091
debug: true
spring:
application:
name: employee-app
---
spring:
profiles: local
#hibernate config
jpa:
database-platform: org.hibernate.dialect.Oracle10gDialect
hibernate:
ddl-auto: update
#Spring Boot Config for Oracle
datasource:
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:#localhost:1521:xe
username: system
password: root
logging:
level:
org.springframework.security: INFO
---
spring:
profiles: default
#hibernate config
jpa:
database-platform: org.hibernate.dialect.Oracle10gDialect
#Spring Boot Config for Oracle
datasource:
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:#localhost:1521:xe
username: system
password: root
logging:
level:
org.springframework.security: INFO
Reading between the lines it looks like Spring doesn't know what database driver to use as none are specified. You created two profiles default and local. Unfortunately default is actually naming the profile and not what you think it was doing. If you want a default configuration you would just specify that in the application.yml not under a specific profile. Then when you activate a profile if there are setting in the profile it would override those defaults.
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active)

Categories