博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
spring boot微服务改造冲突
阅读量:6297 次
发布时间:2019-06-22

本文共 37601 字,大约阅读时间需要 125 分钟。

1.报错:

13:57:49.959 [main] ERROR org.springframework.boot.SpringApplication - Application startup failedjava.lang.IllegalAccessError: tried to access method org.springframework.core.convert.support.DefaultConversionService.addCollectionConverters(Lorg/springframework/core/convert/converter/ConverterRegistry;)V from class org.springframework.boot.bind.RelaxedConversionServiceat org.springframework.boot.bind.RelaxedConversionService.
(RelaxedConversionService.java:52) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.bind.RelaxedDataBinder.modifyProperties(RelaxedDataBinder.java:148) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:128) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.validation.DataBinder.bind(DataBinder.java:691) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.getFirstNonLoopbackHostInfo(HostInfoEnvironmentPostProcessor.java:47) ~[spring-cloud-commons-1.2.4.RELEASE.jar:1.2.4.RELEASE]at org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.postProcessEnvironment(HostInfoEnvironmentPostProcessor.java:34) ~[spring-cloud-commons-1.2.4.RELEASE.jar:1.2.4.RELEASE]at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:182) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:168) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:175) [spring-cloud-context-1.2.4.RELEASE.jar:1.2.4.RELEASE]at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:98) [spring-cloud-context-1.2.4.RELEASE.jar:1.2.4.RELEASE]at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:64) [spring-cloud-context-1.2.4.RELEASE.jar:1.2.4.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163) [spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136) [spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119) [spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at com.newland.dc.msgout.Application.main(Application.java:15) [classes/:?]13:57:49.965 [main] ERROR org.springframework.boot.SpringApplication - Application startup failedjava.lang.IllegalAccessError: tried to access method org.springframework.core.convert.support.DefaultConversionService.addCollectionConverters(Lorg/springframework/core/convert/converter/ConverterRegistry;)V from class org.springframework.boot.bind.RelaxedConversionServiceat org.springframework.boot.bind.RelaxedConversionService.
(RelaxedConversionService.java:52) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.bind.RelaxedDataBinder.modifyProperties(RelaxedDataBinder.java:148) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:128) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.validation.DataBinder.bind(DataBinder.java:691) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.getFirstNonLoopbackHostInfo(HostInfoEnvironmentPostProcessor.java:47) ~[spring-cloud-commons-1.2.4.RELEASE.jar:1.2.4.RELEASE]at org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.postProcessEnvironment(HostInfoEnvironmentPostProcessor.java:34) ~[spring-cloud-commons-1.2.4.RELEASE.jar:1.2.4.RELEASE]at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:182) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:168) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:175) ~[spring-cloud-context-1.2.4.RELEASE.jar:1.2.4.RELEASE]at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:98) ~[spring-cloud-context-1.2.4.RELEASE.jar:1.2.4.RELEASE]at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:64) ~[spring-cloud-context-1.2.4.RELEASE.jar:1.2.4.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at com.newland.dc.msgout.Application.main(Application.java:15) [classes/:?]Process finished with exit code 1

原因是activeMq的包冲突

将:

org.apache.activemq
activemq-all
5.13.2

改为

org.apache.activemq
activemq-core
5.7.0

2.报错:

[INFO] Scanning for projects...[WARNING][WARNING] Some problems were encountered while building the effective model for com.newland.dc:msgcommon:jar:1.0.0-SNAPSHOT[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.mybatis.spring.boot:mybatis-spring-boot-starter:jar -> version (?) vs 1.1.1 @ com.newland.dc:svc-parent:2.0.1-SNAPSHOT, /Users/garfield/Workspaces/DGW/DigitalCitizen/Develop/SourceCode/Code/trunk/dc-service-platform/service/pom/pom.xml, line 600, column 21[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.logging.log4j:log4j-api:jar -> duplicate declaration of version ${log4j2.version} @ com.newland.dc:svc-parent:2.0.1-SNAPSHOT, /Users/garfield/Workspaces/DGW/DigitalCitizen/Develop/SourceCode/Code/trunk/dc-service-platform/service/pom/pom.xml, line 617, column 21[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.logging.log4j:log4j-core:jar -> duplicate declaration of version ${log4j2.version} @ com.newland.dc:svc-parent:2.0.1-SNAPSHOT, /Users/garfield/Workspaces/DGW/DigitalCitizen/Develop/SourceCode/Code/trunk/dc-service-platform/service/pom/pom.xml, line 622, column 21[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: ch.qos.logback:logback-classic:jar -> duplicate declaration of version 1.2.3 @ com.newland.dc:svc-parent:2.0.1-SNAPSHOT, /Users/garfield/Workspaces/DGW/DigitalCitizen/Develop/SourceCode/Code/trunk/dc-service-platform/service/pom/pom.xml, line 628, column 21[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ com.newland.dc:svc-parent:2.0.1-SNAPSHOT, /Users/garfield/Workspaces/DGW/DigitalCitizen/Develop/SourceCode/Code/trunk/dc-service-platform/service/pom/pom.xml, line 436, column 21[WARNING][WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.[WARNING][WARNING] For this reason, future Maven versions might no longer support building such malformed projects.[WARNING][INFO][INFO] ------------------------------------------------------------------------[INFO] Building msgcommon 1.0.0-SNAPSHOT[INFO] ------------------------------------------------------------------------[INFO][INFO] --- spring-boot-maven-plugin:1.5.8.RELEASE:build-info (default) @ msgcommon ---[INFO][INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ msgcommon ---[INFO] Using 'UTF-8' encoding to copy filtered resources.[INFO] Copying 0 resource[INFO] Copying 0 resource[INFO][INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ msgcommon ---[INFO] Changes detected - recompiling the module![INFO] Compiling 18 source files to /Users/garfield/Workspaces/DGW/DigitalCitizen/Develop/SourceCode/Code/trunk/dc-service-platform/service/msgcenter/msgcommon/target/classes[INFO][INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ msgcommon ---[INFO] Using 'UTF-8' encoding to copy filtered resources.[INFO] Copying 0 resource[INFO][INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ msgcommon ---[INFO] Nothing to compile - all classes are up to date[INFO][INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ msgcommon ---[INFO][INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ msgcommon ---[INFO] Building jar: /Users/garfield/Workspaces/DGW/DigitalCitizen/Develop/SourceCode/Code/trunk/dc-service-platform/service/msgcenter/msgcommon/target/msgcommon-1.0.0-SNAPSHOT.jar[INFO][INFO] >>> maven-source-plugin:3.0.0:jar (default) > generate-sources @ msgcommon >>>[INFO][INFO] <<< maven-source-plugin:3.0.0:jar (default) < generate-sources @ msgcommon <<<[INFO][INFO] --- maven-source-plugin:3.0.0:jar (default) @ msgcommon ---[INFO] Building jar: /Users/garfield/Workspaces/DGW/DigitalCitizen/Develop/SourceCode/Code/trunk/dc-service-platform/service/msgcenter/msgcommon/target/msgcommon-1.0.0-SNAPSHOT-sources.jar[INFO][INFO] --- spring-boot-maven-plugin:1.5.8.RELEASE:repackage (default) @ msgcommon ---[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 4.446 s[INFO] Finished at: 2018-01-08T14:19:57+08:00[INFO] Final Memory: 62M/501M[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.8.RELEASE:repackage (default) on project msgcommon: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.8.RELEASE:repackage failed: Unable to find main class -> [Help 1][ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionExceptionProcess finished with exit code 1

打包报错,非spring-boot工程将不能使用spring-boot的打包插件打包,去除spring-boot-maven-plugin即可,根据需要清理依赖结构

3.报错:

2018-01-08 15:45:12,350 main ERROR Unknown object "logger" of type org.apache.logging.log4j.core.config.LoggerConfig is ignored: try nesting it inside one of: ["Appenders", "Loggers", "Properties", "Scripts", "CustomLevels"].2018-01-08 15:45:12,355 main ERROR Unknown object "root" of type org.apache.logging.log4j.core.config.LoggerConfig is ignored: try nesting it inside one of: ["Appenders", "Loggers", "Properties", "Scripts", "CustomLevels"].SLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/Users/garfield/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: Found binding in [jar:file:/Users/garfield/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.7/log4j-slf4j-impl-2.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]2018-01-08 15:45:19.055 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-12018-01-08 15:45:19.294 INFO 5957 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson2018-01-08 15:45:19.294 INFO 5957 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson2018-01-08 15:45:19.407 INFO 5957 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml2018-01-08 15:45:19.407 INFO 5957 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml2018-01-08 15:45:19.616 INFO 5957 --- [ main] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration2018-01-08 15:45:19.637 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : Disable delta property : false2018-01-08 15:45:19.637 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null2018-01-08 15:45:19.637 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false2018-01-08 15:45:19.637 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : Application is null : false2018-01-08 15:45:19.637 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true2018-01-08 15:45:19.638 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true2018-01-08 15:45:19.638 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server2018-01-08 15:45:19.851 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : The response status is 2002018-01-08 15:45:19.853 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : Not registering with Eureka server per configuration2018-01-08 15:45:19.856 INFO 5957 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1515397519855 with initial instances count: 8. ____ _ __ _ _/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) )' |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot :: (v1.5.8.RELEASE)2018-01-08 15:45:27.452 INFO 5957 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]2018-01-08 15:45:27.454 INFO 5957 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.232018-01-08 15:45:27.565 ERROR 5957 --- [cat-startStop-1] org.apache.catalina.core.ContainerBase : A child container failed during startjava.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]at java.util.concurrent.FutureTask.report(FutureTask.java:122) [na:1.8.0_144]at java.util.concurrent.FutureTask.get(FutureTask.java:192) [na:1.8.0_144]at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:939) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [tomcat-embed-core-8.5.23.jar:8.5.23]at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_144]at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_144]at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_144]at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.23.jar:8.5.23]... 6 common frames omittedCaused by: org.apache.catalina.LifecycleException: Failed to start component [Pipeline[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5117) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.23.jar:8.5.23]... 6 common frames omittedCaused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.authenticator.NonLoginAuthenticator[]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:182) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.23.jar:8.5.23]... 8 common frames omittedCaused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1141) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.23.jar:8.5.23]... 10 common frames omitted2018-01-08 15:45:27.567 ERROR 5957 --- [ main] org.apache.catalina.core.ContainerBase : A child container failed during startjava.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_144]at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_144]at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:939) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.startup.Tomcat.start(Tomcat.java:367) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:99) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.
(TomcatEmbeddedServletContainer.java:84) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:554) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:179) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) [spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at com.newland.dc.face.Application.main(Application.java:16) [classes/:na]Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_144]at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_144]at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_144]at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_144]Caused by: org.apache.catalina.LifecycleException: A child container failed during startat org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:948) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.23.jar:8.5.23]... 6 common frames omitted15:45:27.583 [main] ERROR org.springframework.boot.SpringApplication - Application startup failedorg.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcatat org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) ~[spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at com.newland.dc.face.Application.main(Application.java:16) [classes/:?]Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcatat org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:123) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.
(TomcatEmbeddedServletContainer.java:84) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:554) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:179) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]... 8 moreCaused by: org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.startup.Tomcat.start(Tomcat.java:367) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:99) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.
(TomcatEmbeddedServletContainer.java:84) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:554) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:179) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]... 8 moreCaused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.startup.Tomcat.start(Tomcat.java:367) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:99) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.
(TomcatEmbeddedServletContainer.java:84) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:554) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:179) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]... 8 moreCaused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.startup.Tomcat.start(Tomcat.java:367) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:99) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.
(TomcatEmbeddedServletContainer.java:84) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:554) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:179) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]... 8 moreCaused by: org.apache.catalina.LifecycleException: A child container failed during startat org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:948) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.apache.catalina.startup.Tomcat.start(Tomcat.java:367) ~[tomcat-embed-core-8.5.23.jar:8.5.23]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:99) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.
(TomcatEmbeddedServletContainer.java:84) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:554) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:179) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]... 8 moreProcess finished with exit code 1

spring-boot认为工程内嵌了web容器,我这里是因为引入了servlet-api包,去掉即可

4.报错:

org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: No serializer found for class com.google.common.cache.CacheStats and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)

spring-boot化之后可能导致部分包无法扫描到,导致一些功能无法使用,这个错误只是其中一种,解决:提交一个bean

@Bean    public ObjectMapper objectMapper() {        return new ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);    }

 

转载地址:http://itlta.baihongyu.com/

你可能感兴趣的文章
将图片转成base64字符串并在JSP页面显示的Java代码
查看>>
js 面试题
查看>>
sqoop数据迁移(基于Hadoop和关系数据库服务器之间传送数据)
查看>>
腾讯云下安装 nodejs + 实现 Nginx 反向代理
查看>>
Javascript 中的 Array 操作
查看>>
java中包容易出现的错误及权限问题
查看>>
AngularJS之初级Route【一】(六)
查看>>
服务器硬件问题整理的一点总结
查看>>
SAP S/4HANA Cloud: Revolutionizing the Next Generation of Cloud ERP
查看>>
Mellanox公司计划利用系统芯片提升存储产品速度
查看>>
白帽子守护网络安全,高薪酬成大学生就业首选!
查看>>
ARM想将芯片装进人类大脑 降低能耗是一大挑战
查看>>
Oracle数据库的备份方法
查看>>
Selenium 自动登录考勤系统
查看>>
关于如何以编程的方式执行TestNG
查看>>
智能照明造福千家万户 家居智能不再是梦
查看>>
物联网如何跳出“看起来很美”?
查看>>
浅谈MySQL 数据库性能优化
查看>>
《UNIX/Linux 系统管理技术手册(第四版)》——1.10 其他的权威文档
查看>>
灵动空间 创享生活
查看>>