
springboot
Wbw Belief
一枚产品梦在路上的全栈架构师。
展开
-
字典 | springboot 返回数据字典翻译
1.前言在处理完数据返回前端时,通常需要做字典翻译,此时就需要一个好用的处理工具,但是依然不方便,对此,再次封装了一次。原理 在接口返回时拦截 --- 反射获取对应字典信息 -- 查询字典值 --- 再次塞入对象里面 --- 返回信息2.代码字典类型处理import java.lang.annotation.*;/** * 字典类型处理 拦截 * <p>常用返回类型处理,不进行四层深层处理</p> * * @author wbw * @d原创 2020-11-20 18:10:20 · 4565 阅读 · 0 评论 -
文件解析 | SpringBoot 自定义注解实现文件自动保存
1.前言在项目里面通常有文件需要处理,但是基本上都差不多,本想抽象成通用的方法,后面改成了注解实现。主要原理在接口方法上添加注解 --- 拦截注解获取文件流 --- 保存文件生成url --- 把结果塞到对应的bean属性里面2.代码文件自动注入注解import com.gl.common.core.constant.GlEnum;import java.lang.annotation.*;/** * 文件自动注入 * <p>作用于方法上,自动处理 Mu原创 2020-11-20 18:01:26 · 859 阅读 · 2 评论 -
SpringBoot H2 | java.lang.IllegalStateException: The file is locked: nio:xxx.mv.db
问题:SpringBoot使用H2数据库时,配置了本地文件地址,此时多个服务访问此地址,出现错误。Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2019-12-19 11:15:59.405 ERROR ...原创 2019-12-19 13:55:31 · 6559 阅读 · 2 评论 -
SpringCloud RestTemplate | java.net.UnknownHostException: xxx
问题eureka 使用 RestTemplate 调用服务时,出现如下错误。2019-12-18 17:32:23.129 ERROR 12204 --- [nio-9913-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in c...原创 2019-12-18 17:44:11 · 2212 阅读 · 0 评论 -
SpringBoot JPA | java.lang.IllegalArgumentException: At least one JPA metamodel must be present!
异常:Caused by: java.lang.IllegalArgumentException: At least one JPA metamodel must be present!Error starting ApplicationContext. To display the conditions report re-run your application with 'd...原创 2019-12-17 13:59:45 · 576 阅读 · 0 评论 -
Springboot Log4j | 排除默认logging,使用log4j
springboot 移除默认logging日志系统,使用自定义log4j。<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot...原创 2019-12-16 22:32:00 · 5261 阅读 · 0 评论 -
Springboot Elasticsearch 异常 | ResponseException:URI [/_cluster/health/], status line [HTTP/1.1 401
今天es 指定端口登录时,出现一个问题:Caused by: org.elasticsearch.client.ResponseException: method [GET], host [http://127.0.0.1:9210], URI [/_cluster/health/], status line [HTTP/1.1 401 Unauthorized]意思就是说,没有权限访问...原创 2019-08-03 10:43:25 · 161375 阅读 · 0 评论 -
SpringCloud 与 SpringBoot 微服务 架构 | 面试题及答案详解
目录1.什么是微服务?2.微服务之间如何独立通讯的?3.SpringCloud 和 Dubbo 有哪些区别?4.SpringBoot 和 SpringCloud 之间关系?5.什么是熔断?什么是服务降级?6.微服务的优缺点是什么?说下你在项目中碰到的坑。7.eureka和zookeeper都可以提供服务注册与发现的功能,请说说两个的区别?8.你所知道微服务的技术栈有...原创 2019-06-15 10:50:08 · 17957 阅读 · 2 评论 -
SpringBoot 接口重启 | 通过 api 接口重启 SpringBoot 应用程序
原因: 在项目实际生产环境中,有时需要 重启 springboot 接口,此时 如果可以一键重启,那岂不是很方便。描述: 重启Spring Boot应用程序的关键步骤是对主类中SpringApplication.run(Application.class,args);方法返回值的处理。通过查看官方文档可以看到,ConfigurableApplicationContext接口类...原创 2019-07-06 12:14:46 · 6601 阅读 · 3 评论 -
SpringCloud概述、SpringCloud是什么? --- 分享
最近想把spring cloud 及 spring boot 常用一套框架从头到尾在搞一遍。先搞点概念,慢慢补全。SpringCloud是什么?- 分布式系统的简化版(官方介绍)- SpringCloud基于SpringBoot提供了一整套微服务的解决方案,包括服务注册与发现,配置中心,全链路监控,服务网关,负载均衡,熔断器等组件,除了基于Netflix的开源组件做高度抽象封装之外...原创 2019-06-06 13:10:40 · 1036 阅读 · 1 评论 -
Dubbo SpringBoot SpringCloud | 常见面试题记录
求大佬解答。Dubbo1. Dubbo中zookeeper做注册中心,如果注册中心集群都挂掉,发布者和订阅者之间还能通信么?2. dubbo服务负载均衡策略?3. Dubbo在安全机制方面是如何解决的?4. dubbo连接注册中心和直连的区别5. dubbo服务集群配置(集群容错模式)6. dubbo通信协议dubbo协议为什么要消费者比提供者个数多?7....原创 2019-04-23 12:50:54 · 2086 阅读 · 0 评论 -
Springboot mybatis 采坑 | You have an error in your SQL syntax; check the manual that corresponds
填坑记录,springboot mybatis mapper文件错误,多了一个','号 . 基本上都是 大意引起的错误,比如:单词写错,类型写错 ,sql 语句错误等等。。。You have an error in your SQL syntax; check the manual that corresponds to your MySQL server具体异常:or...原创 2019-01-09 14:16:50 · 2197 阅读 · 1 评论 -
linux---springboot启动方式 java--记录
转:https://www.cnblogs.com/woms/p/6145688.html转载 2019-01-09 09:41:51 · 181 阅读 · 0 评论 -
Springboot 日志 | 修改默认彩色日志配置
springboot 彩色日志实现yml: 默认扫描resource 下面日志文件。 level:指定的级别 com.xxx:包名 debug:日志级别,这里的日志是指你的包所包含得到日志。pom:springboot内嵌日志,所以要移除,在最顶端boot依赖移除内置日志添加日志依赖log4j2.xml:项目路径:...原创 2019-01-02 11:36:01 · 5360 阅读 · 0 评论 -
springboot actuator - 健康监控
boot 整合actuator :pom:yml:所有数据皆以 JSON 格式返回所有基本信息http://localhost:8090/actuator常用方法(前缀路径统一格式:http://localhost:8090/actuator)HTTP方法 路径 描述 鉴权 GET /autoconfig 查看自动...原创 2019-01-02 11:25:58 · 184 阅读 · 0 评论 -
Springboot 框架 | 常用 微服务 整合框架
记录一些常用的框架,方便日后学习使用spring boot https : 协议加密spring boot fastfds : 文件存储spring boot driud : 数据了连接池监控spring boot websocket : 即时通讯spring boot hikaricp:数据库连接池速度比csp0快50倍spring boot jackson : 统一...原创 2019-01-02 11:22:34 · 705 阅读 · 0 评论 -
idea springboot 打jar包 --- 小白教程
说明:idea 可以天然支持springboot全家桶,所以打jar包 也是十分方便。1.选择对应的按钮。这里如果找不到这个按钮也没关系,可以通过下面这个方式。会出现如下页面。。。 2.选择对应的 jar 包 ,打包。第一步.第二步这里选择和我保持一致最好。第三步至此会在 resource 出现这个目录。 ...原创 2019-01-06 10:59:52 · 1258 阅读 · 0 评论 -
Springboot tomcat 连接超时 | ClientAbortException: java.io.IOException: 您的主机中的软件中止了一个已建立的连接。
在打断点时,前端进行数据api接口访问,此时断点时间过长机会出现以下异常:[14:48:49:958] [ERROR] - com.yryj.controller.exception.GlobalExceptionHandler.allExceptionHandler(GlobalExceptionHandler.java:66) - 全局异常捕获org.apache.catalin...原创 2019-01-05 14:00:56 · 22079 阅读 · 7 评论 -
springboot 依赖注入异常 --- 记录
循环依赖注入嵌套异常,原因:a依赖b,b依赖c,c依赖a,在使用 @Autowired 就会出现如下异常。[11:22:17:166] [ERROR] - org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter.report(LoggingFailureAnalysisReporter.java:42...原创 2019-01-05 13:56:55 · 953 阅读 · 0 评论