第一个问题:(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 添加以下东西

<!-- Cat 集成 -->
<dependency>
<groupId>com.madai.rong</groupId>
<artifactId>rong-cat</artifactId>
<version>1.0.4-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>com.dianping.cat</groupId>
<artifactId>cat-client</artifactId>
<version>1.4.0-RELEASE</version>
</dependency>
<!-- Cat 集成 END -->

本地需要添加客户端配置文件。

在/data/appdatas/cat目录下添加client.xml

内容如下:

<?xml version="1.0" encoding="utf-8"?>

<config mode="client" xmlns:xsi="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="config.xsd" enabled="true">
          <servers>
                 <server ip="*.*.*.*" port="2280" http-port="10083" />
          </servers>
</config>

注意,我这里犯了一个错,就是编写xml的时候,我习惯性的空了一行,打了个回车,于是解析xml的时候报错了,切记不能回车。

over...

最新文章

  1. Lind.DDD.Utils.HttpHelper里静态对象引出的Http超时问题
  2. js实现点击修改按钮之后单元格变成可编辑状态
  3. Eclipse运行内存溢出
  4. hiho #1305 区间求差
  5. Zabbix汉化方法
  6. 使用notepad++进行格式转换
  7. MySQL中进行树状所有子节点的查询
  8. spring core源码解读之ASM4用户手册翻译之一asm简介
  9. python细节
  10. Spring4分别整合mongo2.X和3.0
  11. HttpServletResponse HttpServletRequest RequestDispatcher
  12. jQuery实现checkbox即点即改,批量计数,以及中间遇到的坑
  13. linux学习之路(3)
  14. identityserver4 代码系列
  15. Unity使用代码动态给按钮赋值各个状态下的图片
  16. SCC的奇葩算法——Kosaraju
  17. 【原创】javascript模板引擎的简单实现
  18. (转)Mysql备份还原数据库之mysqldump实例及参数详细说明
  19. [Android] repo 下载Android源码(国内镜像)
  20. IOS把图片做成圆形效果

热门文章

  1. msyql: navicat 连接时msyql遇到的问题
  2. CUDA ---- 线程配置
  3. BZOJ4559 JLOI2016成绩比较(容斥原理+组合数学+斯特林数)
  4. bzoj 4448 [Scoi2015]情报传递 (树链剖分+主席树)
  5. hdwiki 参考资料改成可点击跳转的(默认不能点)
  6. BZOJ 3167: [Heoi2013]Sao
  7. luogu3778/bzoj4898 商旅 (floyd+分数规划+spfa)
  8. Atcoder Grand 006 C-Rabbit Exercise
  9. python---补充django中文报错(2),Django3.5出错
  10. poj 2438 Children&#39;s Dining