SpringBoot
这是我学习springboot的过程中遇到的一些问题,分享出来,希望可以帮到需要的人,同时巩固自己的知识体系。
maslii
独立之精神,自由之思想
展开
-
SpringBoot+RabbitMQ之MQTT协议的生产和消费
一、xml文件: <!--mqtt依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-integration</artifact...原创 2020-03-30 22:18:24 · 4500 阅读 · 4 评论 -
SpringBoot+RabbitMQ之AMQP协议的生产和消费
一、xml文件:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId></dependency>二、配置文件信息:spring.rabbitmq...原创 2020-03-30 22:14:34 · 400 阅读 · 0 评论 -
SpringBoot 启动报读取不到 logback-spring.xml
Logging system failed to initialize using configuration from 'classpath:config/logback-spring.xml'加上JAR试一下: <dependency> <groupId>commons-dbcp</groupId> &...原创 2019-10-21 02:04:42 · 1881 阅读 · 0 评论 -
springboot activiti 启动报找不到表,即不会自动创建表
解决方法:(1)把mysql8.0的版本改成5.0的<dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.41</version></dependency>...原创 2019-10-14 10:33:24 · 1519 阅读 · 0 评论 -
springboot 2.1.9 Jar 包引用
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apach...原创 2019-10-12 16:21:27 · 630 阅读 · 0 评论 -
springboot+ehcache 实现本地缓存
一、简介 EHCache是一个快速的、轻量级的、易于使用的、进程内的缓存。它支持read-only 和 read/write 缓存,内存和磁盘缓存。二、使用pom.xml文件: <dependency> <groupId>org.ehcache</groupId> <artifactId>ehcac...原创 2018-09-04 21:21:26 · 2613 阅读 · 1 评论 -
springboot 2.X+redis+springcache 之 数据缓存
Redis简介Redis支持数据的持久化,可以将内存中的数据保存在磁盘中,重启的时候可以再次加载进行使用。Redis不仅仅支持简单的key-value类型的数据,同时还提供list,set,zset,hash等数据结构的存储。Redis支持数据的备份,即master-slave模式的数据备份。 第一步: pom.xml文件:<dependency> <...原创 2018-09-05 16:44:22 · 3119 阅读 · 3 评论 -
SpringBoot的@ManyToMany出现异常: Could not write JSON: Infinite recursion (StackOverflowError)
问题描述:在使用SpringBoot进行多对多的关联查询的时候,写数据回页面时出现异常,如下所示:Failed to write HTTP message:org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Infinite recursion (Stac...原创 2018-08-11 17:44:52 · 3378 阅读 · 0 评论 -
SpringBoot @ManyToMany之Caused by: org.hibernate.HibernateException: cannot simultaneously fetch mult
问题描述: Caused by: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags解决方法: @ManyToMany或@OneToMany的Many方此时一定用Set容器来存放,而不能用List集合。 不过Hibernate有些功能超越了JPA规范,它支持真正的List...原创 2018-08-15 11:18:58 · 367 阅读 · 0 评论 -
Springboot jpa之分页查询Pageable
/** * 将MySQL的limit的offset、limit参数转化为Pageable的page、size,同时加入排序字段properties * @param limit 个数 * @param offset 偏移量 * @param properties 排序字段 * @return */ public stati...原创 2018-08-17 19:26:11 · 11172 阅读 · 1 评论 -
springboot jpa之复杂查询语句(会一种即可)
注意,jpa的复杂查询有很多种方式,原则上能实现自己的要求即可,无需全部掌握,故这里就介绍一种,只要你知道继承JpaRepository意味着什么,我相信你是看得懂的! 不要害怕未知,否则一辈子都跨不过去!1、总体上来说,对于自己编写复杂查询语句的,先是在UserRepository(持久层)继承JpaSpecificationExecutor&lt;T&gt;(这个T就是你要操作的...原创 2018-08-17 19:56:21 · 5816 阅读 · 0 评论 -
springboot+shiro+ehcache整合之Another unnamed CacheManager already exists in the same VM.
ehcache.xml配置文件<?xml version="1.0" encoding="UTF-8"?><ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd"...原创 2018-09-04 11:14:46 · 2673 阅读 · 0 评论 -
springboot+shiro+ehcache整合之Cache configuration does not exist 'ServletContext resource [ehcache.xml]
一、报错提示:Cache configuration does not exist 'ServletContext resource [ehcache.xml]二、分析:文件在项目里面,而且可以访问没有问题,原教程用的是.yml格式,后来被我改为.properties,可能就是格式错了。三、原因:用.yml格式:cache: type: ehcache eh...原创 2018-09-04 11:31:00 · 6021 阅读 · 7 评论 -
springboot+logback+MySQL之日志打印并保存到MySQL
第一步: pom.xml文件&lt;dependency&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt; &原创 2018-09-04 17:58:12 · 6145 阅读 · 2 评论