2019年4月3日

spring boot 两种配置文件application和bootstrap的区别

摘要: spring cloud 配置中心学习时遇到的坑: 服务消费端使用 spring.cloud.config.discovery.service-id ,spring.cloud.config.discovery.enabled 设置自动发现配置中心服务时启动服务消费端 异常:java.lang.Il 阅读全文

posted @ 2019-04-03 14:09 Mr-xt 阅读(2079) 评论(0) 推荐(0) 编辑

2019年3月19日

aop 简单使用

摘要: 配置:<aop:aspectj-autoproxy /> @Aspect@Componentpublic class AopTest { @Pointcut("execution(* com.xt.service.duocai.campus.impl.CampusService.*(..))") p 阅读全文

posted @ 2019-03-19 10:27 Mr-xt 阅读(190) 评论(0) 推荐(0) 编辑

2019年3月15日

spring boot 事物简单使用

摘要: spring boot 事物: 1.在启动类加注解 :@EnableTransactionManagement 2.在需要事物的方法上添加注解:@Transactional(rollbackFor = Exception.class) spring事物配置: 一 . 注解方式: 1. xxx.xml 阅读全文

posted @ 2019-03-15 17:19 Mr-xt 阅读(353) 评论(0) 推荐(0) 编辑

2019年1月8日

tomcat8 中 get请求特殊字符过滤

摘要: 请求中包含特殊字符 [] | {} 发送get请求失败: 原因: 这是因为Tomcat严格按照 RFC 3986规范进行访问解析,而 RFC 3986规范定义了Url中只允许包含英文字母(a-zA-Z)、数字(0-9)、-_.~4个特殊字符以及所有保留字符(RFC3986中指定了以下字符为保留字符: 阅读全文

posted @ 2019-01-08 10:00 Mr-xt 阅读(1713) 评论(0) 推荐(0) 编辑

2019年1月4日

eureka服务端添加security验证之后,client注册失败

摘要: 问题:erueka服务端添加security验证之后,client注册失败: com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server 解决: 在eure 阅读全文

posted @ 2019-01-04 16:45 Mr-xt 阅读(846) 评论(0) 推荐(0) 编辑

2018年12月5日

LinkedBlockingQueue 简单使用

摘要: 简介:LinkedBlockingQueue 是线程安全的实现了先入先出等特性,其中主要用到put和take方法,put方法在队列满的时候会阻塞直到有队列成员被消费,take方法在队列空的时候会阻塞,直到有队列成员被放进来。 1.定义方式-->可自定义长度,不定义长度默认为Integer.MAX_V 阅读全文

posted @ 2018-12-05 10:00 Mr-xt 阅读(647) 评论(0) 推荐(0) 编辑

2018年11月26日

Manual close is not allowed over a Spring managed SqlSession

摘要: 原因:SqlSessionTemplate你不可以手动关闭。SqlSessionTemplate是一个代理类,内部他会为每次请求创建线程安全的sqlsession,并与Spring进行集成.在你的方法调用完毕以后他会自动关闭的。(参考网上资料) 如不设置为“prototype”模式(普通模式,每次新 阅读全文

posted @ 2018-11-26 13:15 Mr-xt 阅读(588) 评论(0) 推荐(0) 编辑

2018年11月21日

spring boot 配置rabbitmq启动遇到的问题

摘要: 问题: 原因:新建的账户是没有远程登录的权限的 需要对登录所用账户授权 解决: rabbitmqctl set_permissions -p / userName '.*' '.*' '.*' 阅读全文

posted @ 2018-11-21 14:46 Mr-xt 阅读(205) 评论(0) 推荐(0) 编辑

2018年11月12日

linux 启动rabbitmq 报错:

摘要: linux 启动rabbitmq 报错: Job for rabbitmq-server.service failed because the control process exited with error code. See "systemctl status rabbitmq-server. 阅读全文

posted @ 2018-11-12 15:07 Mr-xt 阅读(1180) 评论(0) 推荐(0) 编辑

2018年11月9日

spring boot 读取自定义properties文件

摘要: @Configuration@Componentpublic class PropertiesConfig { private static final String[] properties = {"/application.properties"}; private static Properties props; private static Map propertiesM... 阅读全文

posted @ 2018-11-09 14:39 Mr-xt 阅读(361) 评论(0) 推荐(0) 编辑

导航