SpringCloud有关Bug
Spring项目中无法引入@Resource注解
解决办法:Spring项目中缺少javax.annotation包的依赖。在maven配置文件pom.xml中加入依赖。
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
javax.net.ssl.SSLException: closing inbound before receiving peer’s close_notify
解决办法:加上useSSL=false
spring.datasource.url = jdbc:mysql://localhost:3306/stu?useSSL=false
java.lang.NoSuchMethodError: javax.annotation.Resource.lookup().
解决办法:在pom.xml文件中加入javax.annotation:
Could not autowire. No beans of ‘UserMapper’ type found
解决办法1.Autowired 后加上(required=false)
解决办法2: setting->editor->inspections->spring->springcore->code->autowiring for bean class 从error 改为 warning
Failed to configure a DataSource: ‘url’ attribute is not specified
未连接上 检查配置文件 这次把server port 12000 少写一个零
java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.base.BaseSelectProvider
MapperScanner导包 错误 需导入 tk mybatis 的包
RestTemplate 接收集合,先接收数组 转化为集合
User[] users = restTemplate.getForObject(url, User[].class);
List userList = Arrays.asList(users);