![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot
CallMeV6
这个作者很懒,什么都没留下…
展开
-
使用appassembler打包springboot项目时出现的主类无法找到问题
问题出现的原因:在pom.xml文件中使用parent的方式继承了springboot的模板 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <v...原创 2018-06-24 17:56:18 · 1747 阅读 · 0 评论 -
SpringBoot自动配置注解原理解析
SpringBoot自动配置注解原理解析1. SpringBoot启动主程序类:@SpringBootApplicationpublic class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, arg...转载 2019-04-08 11:05:18 · 1105 阅读 · 0 评论 -
微服务消息传输过程中的一些问题
今天是周六,在公司加班完成一个基于微服务架构的项目,出现了一个很尴尬、很诡异的问题,在此记录该问题当用户登录时,用户微服务需要调用权限认证服务返回该用户拥有的所有角色名称,为了减少服务调用次数,所以权限认证服务的返回数据时 Map<Integer, List<String>> 即 Map<userid,List<rolename>>,但是问题出现...原创 2018-11-17 11:42:30 · 468 阅读 · 0 评论 -
Springboot开发常见问题总结
本文会持续不定时更新1.配置静态资源路径spring.resources.static-locations=classpath:/templates/,classpath:/static/特别注意:路径最后的"/"千万不能少了,否则该条配置就失效了。错误的路径:classpath:/templates正确的路径:classpath:/templates/2.返回的视图...原创 2018-09-20 16:39:54 · 1818 阅读 · 0 评论 -
springboot编程式指定默认的application.properties文件路径
解决方案一:编程式指定 Properties defaultProperties = new Properties();InputStream in; try { in = new FileInputStream("E:/conf/application.properties"); defaultProperties.load(in); in.close();...原创 2018-07-05 18:15:24 · 4391 阅读 · 0 评论 -
使用Maven打包SpringBoot程序,出现主类清单无法找到的异常
前提约束1.必须是SpringBoot的项目2.项目中可以多个主类,但是不能存在多个@SpringBootApplication标识的类 否则maven打包时就懵了,不知道该选谁作为主类解决方案很简单,只要在pom.xml中加上一个打包插件配置就行 <build> <plugins> <plugin> <groupId>org....原创 2018-07-04 11:23:25 · 734 阅读 · 0 评论 -
使用Spring时出现无法自动装配的问题
问题描述 在使用Spring进行自动装配的时候(尤其是装配接口的时候),有时会出现装配失效的问题,使用@ComponentScan注解也无法完成 解决方案 修改包结构。 将SpringBootApplication放置到顶级根目录下,这样Spring容器就会默认加载出所有的Bean了, 至于为什么@ComponentScan无法完成自动装配的问题还有待解决,在此先记录下该问...原创 2018-06-29 14:24:55 · 5928 阅读 · 0 评论 -
SpringBoot + Zookeeper的服务注册与发现
1.SpringBoot与Zookeeper的通信问题 注意关闭zookeeper服务的防火墙 临时关闭systemctl stop firewalld 禁止开机启动systemctl disable firewalld2.包冲突问题 最常见的问题是slf4j与log4j的包冲突 解决方案:在zookeeper中去除对slf4...原创 2018-06-24 21:29:51 · 2591 阅读 · 0 评论 -
自定义Spring Boot Starter开发教程
1.前言随着Spring的日渐臃肿,为了简化配置、开箱即用、快速集成,Spring Boot 横空出世。目前已经成为 Java 目前最火热的框架了。平常我们用Spring Boot开发web应用。Spring mvc 默认使用tomcat servlet容器, 因为Spring mvc组件集成了spring-boot-starter-tomcat 。但是现在undertow servlet容器...转载 2019-08-20 10:03:37 · 237 阅读 · 0 评论