- 博客(12)
- 资源 (5)
- 问答 (2)
- 收藏
- 关注
原创 使用ObjectMapper将字符串转为json,或者json转为对象
首先加入依赖: <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> &l...
2018-10-22 13:43:07 10765
原创 springboot创建新module报错- 错误: 找不到或无法加载主类
选择Edit Configurations...最下面有报错信息将Use classpath of module选择成新建的module的名字,这里我新建的midule的名字是web选完之后,报错消失,项目即可正常启动...
2018-10-16 16:48:02 3729 1
原创 JPA的findone()方法报错
jpa的2.x版本中不能在使用findone()方法,而是这样用public void decreaseStock(List<DTO> DTOList) { for(DTO dto:DTOList){ Optional<User> user=userRepository.findById(dto.getProductId()); }...
2018-10-15 11:47:38 793
原创 springcloud使用feign报错
报错Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.FeignException: status 405 reading ProductClient#li...
2018-10-15 11:24:35 847
原创 使用jpa查询如果入参是List,怎么办?
在repository类下的方法后添加In即可:类似:List<User> findByIdIn(List<String> id);
2018-10-15 10:16:36 13973 2
原创 使用RestTemplate时报错java.lang.IllegalStateException: No instances available for 127.0.0.1
我在RestTemplate的配置类里使用了 @LoadBalanced@Componentpublic class RestTemplateConfig { @Bean @LoadBalanced public RestTemplate restTemplate(){ return new RestTemplate(); }}再调用...
2018-10-14 14:00:22 8736 3
原创 springboot集成mybatis实现crud,并简单介绍mybatis的xml配置
mybatis无法像jpa一样自动建表,表需提前建好添加依赖<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId></dependency><!--mybatis-->&l...
2018-10-09 21:06:53 549
原创 SpringBoot+Redis实现springsecurity
引入依赖:<!--redis--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId></dependency>c...
2018-10-09 17:36:10 5332 2
原创 springboot+thymeleaf实现springsecurity
依赖:<!--Spring Security的依赖--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId></dependen...
2018-10-09 16:04:05 1929 1
原创 springboot集成elasticsearch
首先加入依赖<!--全文搜索--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-elasticsearch</artifactId&...
2018-10-08 14:55:30 329
原创 springboot集成elasticsearch时报错NoNodeAvailableException[None of the configured nodes are available: [{#
我在集成elasticsearch在idea的控制台里出现如下报错,但是我的配置是没有问题的NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{c86bxOiITCqF-lqJc2C-XQ}{localhost}{127.0.0.1:9300}]] at org.e...
2018-10-08 14:44:21 2990
几个常用的js+css
2018-09-26
TA创建的收藏夹 TA关注的收藏夹
TA关注的人