![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring
littlehaes
这个作者很懒,什么都没留下…
展开
-
spring事务传播
REQUIREDSupport a current transaction, create a new one if none exists.支持外层事务, 如果不存在外层事务则创建一个新事务; 当前事务和外层事务一块提交一块回滚(一起)REQUIRES_NEWCreate a new transaction, and suspend the current transaction if one exists.创建一个新事务, 如果存在外层事务则把外层事务挂起; 当前事务执行完成后再执行外层事务(原创 2020-09-18 10:11:52 · 529 阅读 · 0 评论 -
spring new和@autowired的区别
welcome to my blog作为刚入门的新手, 今天突然想到一个问题, 使用@autowired注解注入一个类, 哪里体现了低耦合? 不还是得输入类的名字吗? 这不就跟new差不多嘛使用@autowired注解怎样体现解耦和?@autowired注入一个对象时, 使用该类实现的接口名即可, 但是如果使用new创建一个实例的话, 必须指明具体的实现类, 例子如下比如有个访问数据库的接...原创 2020-04-09 23:50:17 · 1979 阅读 · 1 评论 -
The field headerImage exceeds its maximum permitted size of 1048576 bytes
welcome to my blog使用spring内置tomcat服务器上传文件失败, 报错如下, 因为默认文件大小上限为1MB2020-03-13 20:10:36,758 ERROR [http-nio-8081-exec-7] o.a.c.c.C.[.[.[.[dispatcherServlet] [DirectJDKLog.java:175] Servlet.service() fo...原创 2020-03-13 20:26:46 · 382 阅读 · 0 评论 -
查看spring-boot-starter-parent 指定的其他包的版本
welcome to my blog问题描述, pom文件中, 特定版本的spring-boot-starter-parent会给出其他包的默认版本, 如果其他包的版本和默认的版本差距过大可能导致使用出现问题, 比如说spring-boot-starter-parent的版本是2.1.5, 给定的elasticsearch包的版本是6.4.3, 如果下载的是7.x.x版本的elasticsear...原创 2020-03-02 20:08:04 · 24073 阅读 · 1 评论 -
SpringBoot整合kafka 执行最基本的测试代码时报错
welcome to my blog问题描述: SpringBoot整合kafka, 执行最基本的测试代码时报错Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.kafka.config.internalK...原创 2020-03-01 12:55:33 · 3681 阅读 · 0 评论 -
updateCommentCount attempted to return null from a method with a primitive return type (int)
报错: org.apache.ibatis.binding.BindingException: Mapper method 'com.nowcoder.community.dao.DiscussPostMapper.updateCommentCount attempted to return null from a method with a primitive return type (int)...原创 2020-02-17 23:32:25 · 449 阅读 · 0 评论 -
Property or field 'createTime' cannot be found on object of type ''Comment' maybe not publicc or not
welcome to my blog渲染html时报错:Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field ‘createTime’ cannot be found on object of type ‘com.nowcoder.community.e...原创 2020-02-17 22:06:35 · 1452 阅读 · 0 评论 -
java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
welcome to my blog错误信息:java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed解决方法, 在连接数据库的配置中增加allowPublicKeyRetrieval=true比如spring.datasource.url=jdbc:mysql://localhost:3...原创 2020-02-12 20:18:35 · 1072 阅读 · 1 评论 -
Failed to start component [Connector[HTTP/1.1-8080]]
welcome to my blog问题描述: 执行spring boot项目时报错: Failed to start component [Connector[HTTP/1.1-8080]] 以及 Caused by: java.net.BindException: Address already in use: bind问题原因: 8080端口被占用解决方法: 换一个端口, 在appl...原创 2020-02-01 23:52:23 · 1188 阅读 · 1 评论 -
Could not autowire. No beans of 'UserMapper' type found
welcome to my blog刚开始学spring boot这些东西, 直接上手项目很懵的感觉… 下面的代码, 在intellij idea中 userMapper下面有红色的波浪线, 显示Could not autowire. No beans of ‘UserMapper’ type found@Autowiredprivate UserMapper userMapper;解决...原创 2020-02-01 22:47:26 · 2188 阅读 · 2 评论 -
java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass
welcome to my blog问题描述: 执行测试类报错: 警告: TestEngine with ID ‘junit-jupiter’ failed to execute tests java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass(Ljava/lang/...原创 2020-01-26 20:01:11 · 2055 阅读 · 0 评论 -
Error:(3, 29) java: 程序包org.junit.jupiter.api不存在
welcome to my blog问题描述, 使用spring initializr创建maven项目, 在intellij idea中编译时报错: Error:(3, 29) java: 程序包org.junit.jupiter.api不存在解决方法, 在pom.xml文件中增加junit的依赖. 我现在用的版本是5.5.0, 最新的版本可以在[这里]https://mvnreposito...原创 2020-01-26 17:30:39 · 33924 阅读 · 14 评论