abs 不能 factory container dap 报错 eem lan
第一个问题:(jar 包依赖冲突)
启动报错,直接贴 log
- zhengxin-third-shanghai-cis [2017-08-21 14:17:49] 56231 WARN [main] - AnnotationConfigEmbeddedwebApplicationContext:487: Exception encountered during context initialization - cancelling refresh attempt
- org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
- at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
- at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
- at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
- at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
- at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
- at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
- at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
- at com.ctc..framework.Server.<init>(Server.java:49)
- at com.ctc..framework.Server.<init>(Server.java:23)
- at com.ctc..third.Main.main(Main.java:23)
- Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
- at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:98)
- at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:75)
- at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:378)
- at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:155)
- at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:157)
- at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
- ... 9 more
- Caused by: org.springframework.beans.factory.BeanCreationException:
- Error creating bean with name 'org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter':
- Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:
- Could not autowire field: private org.springframework.boot.autoconfigure.web.HttpMessageConverters
- org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.messageConverters;
- nested exception is org.springframework.beans.factory.BeanCreationException:
- Error creating bean with name 'org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration':
- Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:
- Could not autowire field: private final java.util.List org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration.converters;
- nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
- Error creating bean with name 'mappingJackson2HttpMessageConverter' defined in class path resource
- [org/springframework/boot/autoconfigure/web/JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration.class]:
- Unsatisfied dependency expressed through constructor argument with index 0 of type [com.fasterxml.jackson.databind.ObjectMapper]:
- : Error creating bean with name 'jacksonObjectMapper' defined in class path resource
- [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]:
- Unsatisfied dependency expressed through constructor argument with index 0 of type
- [org.springframework.http.converter.json.Jackson2ObjectMapperBuilder]:
- : Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource
- [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]:
- Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
- Failed to instantiate [org.springframework.http.converter.json.Jackson2ObjectMapperBuilder]:
- Factory method 'jacksonObjectMapperBuilder' threw exception; nested exception is java.lang.NoSuchMethodError:
- org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.applicationContext(Lorg/springframework/context/ApplicationContext;)
- Lorg/springframework/http/converter/json/Jackson2ObjectMapperBuilder;; nested exception is org.springframework.beans.factory.BeanCreationException:
- Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource
- [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]:
- Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
- Failed to instantiate [org.springframework.http.converter.json.Jackson2ObjectMapperBuilder]:
- Factory method 'jacksonObjectMapperBuilder' threw exception; nested exception is java.lang.NoSuchMethodError:
- org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.applicationContext(Lorg/springframework/context/ApplicationContext;)
- Lorg/springframework/http/converter/json/Jackson2ObjectMapperBuilder;;
- nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
- Error creating bean with name 'jacksonObjectMapper' defined in class path resource
- [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]:
- Unsatisfied dependency expressed through constructor argument with index 0 of type
- [org.springframework.http.converter.json.Jackson2ObjectMapperBuilder]:
- : Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource
- [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]:
- Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
- Failed to instantiate [org.springframework.http.converter.json.Jackson2ObjectMapperBuilder]:
- Factory method 'jacksonObjectMapperBuilder' threw exception; nested exception is java.lang.NoSuchMethodError:
- org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.applicationContext(Lorg/springframework/context/ApplicationContext;)
- Lorg/springframework/http/converter/json/Jackson2ObjectMapperBuilder;;
- nested exception is org.springframework.beans.factory.BeanCreationException:
- Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource
- [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]:
- Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
- Failed to instantiate [org.springframework.http.converter.json.Jackson2ObjectMapperBuilder]:
- Factory method 'jacksonObjectMapperBuilder' threw exception; nested exception is java.lang.NoSuchMethodError:
- org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.applicationContext(Lorg/springframework/context/ApplicationContext;)
- Lorg/springframework/http/converter/json/Jackson2ObjectMapperBuilder;
最重要的是
- Error creating bean with name'jacksonObjectMapperBuilder'defined in class path resource
这个错
原因:pom.xml 中的 jar 包依赖冲突了;
解决办法:
jackson-databind
stackoverflow 上面说的很清楚,是这个 jar 包冲突了。
右键 pom.xml,打开项目中的 maven,show dependencies,搜索 jackson-databind,右键 excloud 就 ok 了;
第二个问题:cat 集成的时候,pom.xml 添加以下东西
本地需要添加客户端配置文件。
在 / data/appdatas/cat 目录下添加 client.xml
内容如下:
<?xml version="1.0"encoding="utf-8"?>
http://www.w3.org/2001/XMLSchema"xsi:noNamespaceSchemaLocation="config.xsd"enabled="true">
注意,我这里犯了一个错,就是编写 xml 的时候,我习惯性的空了一行,打了个回车,于是解析 xml 的时候报错了,切记不能回车。
over...
cat 集成项目所遇到的一些坑
来源: http://www.bubuko.com/infodetail-2272134.html