会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
天生自然
Powered by
博客园
博客园
|
首页
|
新随笔
|
联系
|
订阅
|
管理
2022年2月18日
Spring Boot整合 Redis
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 19:58 吴裕雄
阅读(55)
评论(0)
推荐(0)
编辑
解决:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
摘要: 这是因为我同时添加了JPA和Redis依赖,可能是里面有相同的自动加载数据源配置类导致; 处理方法一:把JPA和Redis依赖去掉其中一个就可以了。 处理方法二:在启动类的注解加上下面的语句就可以了。 @SpringBootApplication(exclude = DataSourceAutoCo
阅读全文
posted @ 2022-02-18 19:28 吴裕雄
阅读(173)
评论(0)
推荐(0)
编辑
Spring Boot整合JPA
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 17:42 吴裕雄
阅读(53)
评论(0)
推荐(0)
编辑
使用配置文件XML的方式整合Mybatis
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 16:33 吴裕雄
阅读(56)
评论(0)
推荐(0)
编辑
使用注解的方式整合MyBatis
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 16:04 吴裕雄
阅读(44)
评论(0)
推荐(0)
编辑
解决:Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
摘要: 把测试运行类的包名修改和启动类的包名一样就可以了。
阅读全文
posted @ 2022-02-18 15:54 吴裕雄
阅读(65)
评论(0)
推荐(0)
编辑
配置文件随机值设置以及参数间引用
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 15:03 吴裕雄
阅读(46)
评论(0)
推荐(0)
编辑
使用@Profile注解进行多环境函数设计
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 14:40 吴裕雄
阅读(72)
评论(0)
推荐(0)
编辑
使用Profile文件进行多环境配置
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 13:45 吴裕雄
阅读(83)
评论(0)
推荐(0)
编辑
使用@Configuration编写自定义配置类
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 09:40 吴裕雄
阅读(156)
评论(0)
推荐(0)
编辑
使用@ImportResource加载XML配置文件设置的Bean
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 09:29 吴裕雄
阅读(144)
评论(0)
推荐(0)
编辑
使用@PropertySource加载自定义配置文件
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 09:09 吴裕雄
阅读(137)
评论(0)
推荐(0)
编辑
读取application.properties参数注入到Bean属性
摘要: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P
阅读全文
posted @ 2022-02-18 08:33 吴裕雄
阅读(141)
评论(0)
推荐(0)
编辑
解决:ApplicationTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration
摘要: 这是在运行测试类的时候提示报错信息; 原因是没有把启动类写好或者是没有配置启动类; 解决如下, 先是要正常写好启动类; 然后把启动类添加到运行的测试类,添加到这个地方:@SpringBootTest; 有两种填写方式,一种是:@SpringBootTest(webEnvironment = Spri
阅读全文
posted @ 2022-02-18 08:24 吴裕雄
阅读(2115)
评论(0)
推荐(0)
编辑