Java开发错误汇总

【2022.05.04】Java 高版本 发邮件、连接SQLServer MySQL 报错 No appropriate protocol (protocol is disabled or cipher suites are inappropriate)

Mac 下:修改:/jdk1.8.0_291.jdk/Contents/Home/jre/lib/security/java.security

jdk.tls.disabledAlgorithms=…
去除 SSLv3, TLSv1, TLSv1.1

【2019.08.03】SpringBoot 报错 Inferred type ‘S’ for type parameter ‘S’ is not within its bound;

解决办法:报错 Inferred type ‘S’ for type parameter ‘S’ is not within its bound

repository.findOne(id) ====> repository.findById(1).orElse(null);
原因: SpringBoot2.x 新特性


【2019.08.03】SpringBoot 单元测试报错:java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration

原因:没在根目录下写一个springboot的启动类 参考


1.eclipse执行maven install报错No compiler is provided in this environment

[ERROR] No compiler is provided in this environment. Perhaps you are
running on a JRE rather than a JDK?

原因是:JRE配置处选择的是另外安装的jre而不是JDK里的JRE
需要改为JDK主目录:
在这里插入图片描述

2.Maven工程运行报错Failed to clean project: Failed to delete

解决办法:解决 Maven工程运行报错Failed to clean project: Failed to delete

在运行maven工程是报“Failed to clean project: Failed to
delete”错误,原因是因为之前编译的工程还在运行,无法clean,导致maven生命周期无法继续进行。

3.严重: A child container failed during start

原因是:可能是 servlet 和 servlet-mapping的servlet-name没有对应
http://www.cnblogs.com/zhaochi/p/7908044.html
在这里插入图片描述

4.could not autowire field

可能原因:
原文链接:could not autowire field 错误解决方式

1.你的BrandServiceImpl必须以@Service或@Component注解才行。

2.自动写入的时候把接口写成实现类了
@Autowired
private BrandServiceImpl brandServiceImpl;
应该是
@Autowired
private BrandService brandService ;

3.在BrandDao 类上加上@Repository注解
4.应该就是dubbo服务调用的次序不正确导致,或者生产者和消费者没有声明

5. Exception sending context initialized event to listener instance of class org.springframework.w

排除常见的配置文件错误后仍然没解决:请注意 dubbo服务注册是否有问题:
ref=“contentServiceImpl” 注意 ref值得首字母是小写的

<dubbo:service interface="....service.ContentService" ref="contentServiceImpl" />
6.Vue Post请求数据问题

https://blog.csdn.net/zzhuan_1/article/details/83745631

7.MyBatis逆向工程生成代码:Mapper.xml无法解析问题

详细配置:https://www.cnblogs.com/whgk/p/7140638.html

  • 这里需要注意一个问题,点击运行之后,就已经帮我们生成好了对应的类,但是我们需要手动刷新项目才看得见,有些人就会觉得看不见,以为没有生效,然后又第二次运行核心代码,这里就会出现一个很严重的问题,[Mapper.xml文件已经存在时,如果进行重新生成则mapper.xml文件时,内容不被覆盖而是进行内容追加,结果导致mybatis解析失败]
    解决办法:删除生成的所有类和mapper.xml,重新在运行一遍即可。
8.Cannot resolve reference to bean ‘searchItemServiceImpl’ while setting bean property ‘ref’

使用了Dubbo 也有一个 Service 注解
检查很多遍配置文件 以及 注解后没发现问题
请检查是否导错包了
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值