SpringBoot
SpringBoot 日常记录
lwdbcy
这个作者很懒,什么都没留下…
展开
-
maven打包无法彻底删除target文件夹的问题
maven clean target 失败原创 2023-01-10 14:28:28 · 2296 阅读 · 1 评论 -
Windows和Linux下停止和启动jar包
windows下使用bat文件启动和停止jar包linux下启动和停止jar包原创 2022-10-11 14:58:21 · 455 阅读 · 0 评论 -
SpringBoot项目依赖、配置分离打包
springboot maven 配置、依赖、打包分离原创 2022-10-04 16:39:08 · 977 阅读 · 0 评论 -
I/O error ... nested exception is java.io.IOException: Stream closed问题
1. Stream closed问题描述:org.springframework.http.converter.HttpMessageNotReadableException: I/O error while reading input message; nested exception is java.io.IOException: Stream closed分析:request中getInputStream()只能调用一次,被多次调用报错原因:Controller层的方法参数使用多个@Requ原创 2021-08-16 10:34:26 · 1708 阅读 · 0 评论 -
@Value 取不到值问题
错误描述:在配日志文件中写入值,在类中使用@Value("${}")注解取值,将这个类使用@component加入到容器中问题原因:使用测试类测试这个类中的方法,使用了new这个类的对象应该使用注解 @Autowired来获取对象的实例...原创 2021-08-06 11:24:41 · 145 阅读 · 0 评论 -
Error creating bean with name ‘namedParameterJdbcTemplate‘......
出现这个错误,其实是我自己非常马虎了,同时引入了spring-boot-starter-jdbc与spring-jdbc这两个依赖,把spring-jdbc移除就行了。 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId>原创 2021-07-27 13:31:16 · 2453 阅读 · 0 评论 -
Spring Security定义登录跳转路径问题,type=Methotd Not Allowed, status=405
问题描述:Spring Security使用.successForwardUrl()定义登陆成功跳转路径总是失败 @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/login.html").permitAll()原创 2021-08-02 11:08:06 · 811 阅读 · 0 评论 -
SpringBoot的多模块项目其他模块无法@Autowired注入common模块对象问题
问题描述:我将RedisConfig配置类和RedisUtil工具类写在common模块并添加到容器中,但是我在另外一个模块A使用@autowired注入RedisUtil时总是报错。No qualifying bean of type XXX原因:@SpringBootApplication注解默认扫描范围为模块A启动类所在的包及其子包范围,所以即使模块A添加了对common模块的依赖也不能扫描到common包下的添加到容器中的类,除非common模块的包路径与A模块相同。解决方法:将co原创 2021-11-10 14:15:26 · 1660 阅读 · 0 评论 -
org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
问题描述:spring: profiles: active: @activatedProperties@在yml读取pom.xml中定义的 profile变量 <profiles> <!-- 开发环境 --> <profile> <id>dev</id> <properties> <activat原创 2021-08-16 16:16:28 · 8948 阅读 · 11 评论 -
maven打包时排除测试类
错误描述:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project xxx: There are test failures.Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.解决方法:方法一:转载 2021-08-23 15:26:16 · 603 阅读 · 0 评论