我昨天有一个正在运行的应用程序。今天开始得到这个。

INFO: Starting service Tomcat
Oct 31, 2014 5:10:11 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Oct 31, 2014 5:10:16 PM org.apache.catalina.core.ApplicationContext log
INFO: Spring WebApplicationInitializers detected on classpath: [org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration@591fb559, com.hidinc.epa.Application@29191b86]
2014-10-31 17:10:16,430 [ost-startStop-1] ERROR SpringApplication              Application startup failed
org.yaml.snakeyaml.parser.ParserException: while parsing MappingNode; duplicate key: spring;  in 'reader', line 41, column 62:
     ... he.org/licenses/LICENSE-2.0.html
                                         ^
    at org.springframework.beans.factory.config.YamlProcessor$StrictMapAppenderConstructor.constructMapping(YamlProcessor.java:375) ~[spring-beans-4.1.2.BUILD-SNAPSHOT.jar:4.1.2.BUILD-SNAPSHOT]
    at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:461) ~[snakeyaml-1.13.jar:?]
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182) ~[snakeyaml-1.13.jar:?]
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:141) ~[snakeyaml-1.13.jar:?]
    at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:108) ~[snakeyaml-1.13.jar:?]
    at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:502) ~[snakeyaml-1.13.jar:?]
    at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:149) ~[spring-beans-4.1.2.BUILD-SNAPSHOT.jar:4.1.2.BUILD-SNAPSHOT]
    at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:136) ~[spring-beans-4.1.2.BUILD-SNAPSHOT.jar:4.1.2.BUILD-SNAPSHOT]
    at org.springframework.beans.factory.config.YamlPropertiesFactoryBean.createProperties(YamlPropertiesFactoryBean.java:122) ~[spring-beans-4.1.2.BUILD-SNAPSHOT.jar:4.1.2.BUILD-SNAPSHOT]
    at org.springframework.beans.factory.config.YamlPropertiesFactoryBean.getObject(YamlPropertiesFactoryBean.java:102) ~[spring-beans-4.1.2.BUILD-SNAPSHOT.jar:4.1.2.BUILD-SNAPSHOT]
    at org.springframework.boot.env.YamlPropertySourceLoader.load(YamlPropertySourceLoader.java:56) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.env.PropertySourcesLoader.load(PropertySourcesLoader.java:126) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadIntoGroup(ConfigFileApplicationListener.java:380) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:368) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:336) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:173) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:144) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:137) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:126) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151) ~[spring-context-4.1.2.BUILD-SNAPSHOT.jar:4.1.2.BUILD-SNAPSHOT]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128) ~[spring-context-4.1.2.BUILD-SNAPSHOT.jar:4.1.2.BUILD-SNAPSHOT]
    at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:100) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:59) ~[spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:289) [spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143) [spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:89) [spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:51) [spring-boot-1.2.0.BUILD-SNAPSHOT.jar:1.2.0.BUILD-SNAPSHOT]
    at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.1.2.BUILD-SNAPSHOT.jar:4.1.2.BUILD-SNAPSHOT]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5423) [tomcat-embed-core-7.0.47.jar:7.0.47]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-7.0.47.jar:7.0.47]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) [tomcat-embed-core-7.0.47.jar:7.0.47]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) [tomcat-embed-core-7.0.47.jar:7.0.47]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_25]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_25]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]

最佳答案

我在application.yml文件中有一个定义,如下所示:

# Spring
spring:
  jpa:
    hibernate.ddl-auto: create-drop
    show-sql: true
spring:
  data:
    rest.baseUri: /api


卸下第二个弹簧:解决了该问题。

关于tomcat - 使用Spring Boot 1.2.0.BUILD-SNAPSHOT异常解析MappingNode,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26684224/

10-16 23:48