Java遇到的异常以及处理办法

❤ 异常
Demo1:
template might not exist or might not be accessible by any of the configured Template Resolvers;
Exception processing template “sys/doUpdateObject”: Error resolving template [sys/doUpdateObject], template might not exist or might not be accessible by any of the configured Template Resolvers
分析:Dao层查不到值,原因Mapper.xml文件namespace中多出一个空格.
Demo2:
标签写成标签,出现空指针异常,select标签有resulType, update标签没有.
Demo3
maven configuration problem
原因分析:这种问题通常就是版本不兼容导致的问题,这里是因为 maven-jar-plugin 插件的版本造成的。
该配置项只是设置了插件 maven-jar-plugin 的版本信息,这个插件的作用是,打jar时,设定manifest的参数,比如指定运行的Main class入口类,以及将依赖的jar包加入到classpath中等
在pom文件 段添加如下配置内容:
<properties
<maven-jar-plugin.version>3.0.0</maven-jar-plugin.version>

Demo4 打包时
错误描述:在执行maven install的时候有时会出现 The requested profile “pom.xml” could not be activated because it does not exist 的错误
解决办法:在项目中单击右键 --属性 --maven,将此处pom.xml清空保存即可
Demo5
mybatisPlus java.lang.Exception: No runnable methods
分析:@Test导包错误
Demo6
SpringBootTest is not an annotation type
原因:该注解与类名SpringBootTest冲突,修改类名即可
Demo7

If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
分析:Yml配置文件错误
Demo 8
redis.clients.jedis.exceptions.JedisClusterException:No way to dispatch this command to Redis Cluster
在jedisCluster执行之前flushALL出现异常
Demo 9
问题:导包路径直接加在前面。解析:出现两个相同名字的包,为了区分开来。

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值