学习错误总结

 

1.Error creating bean with name 'entityManagerFactory' defined in class path resource 解决

entitiy没有被创建,

我的错误原因呢是entitiy没有在逐渐上标注@Id和@GenerateValue

 

2.Error executing DDL via JDBC Statement报错可能原因是列名中有关键字,所以命名的时候要加上一些前缀,避免这种问题

 

3.naming.physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl加上这句为了解决springboot创建表时自动加下划线的问题

4.springboot 实体类自动生成hibernate_sequence表问题

 

将ID生成略组由@GeneratedValue改成@GeneratedValue(strategy = GenerationType.IDENTITY)

5.java FTP上传文件为空改成被动模式

zookeeper 集群启动不成功之前还有相同端口的zookeeper在运行

6.No identifier specified for entity: com.example.demo.test.model.InquiryTable

实体类中要声明@Id   //声明这个ID是主键ID

@GeneratedValue(strategy = GenerationType.IDENTITY)@GeneratedValue不是必须的

7.Description:


Field inquiryTableMapper in com.example.demo.test.service.impl.InquiryTableServiceImpl required a bean of type 'com.example.demo.test.dao.InquiryTableMapper' that could not be found.
Action:

Consider defining a bean of type 'com.example.demo.test.dao.InquiryTableMapper' in your configuration.

解决方法:要在mapper层添加@Mapper注解

8.Invalid bound statement (not found): com.example.demo.test.dao.InquiryTableMapper.findAll] with root cause

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.example.demo.test.dao.InquiryTableMapper.findAll

我的错误原因是mapper接口中方法名和xml文件中的id不匹配,另外还有application中配置的扫描路径是*plantmapper,而这个mapper的名字是InquiryTableMapper.所以没有被扫描到

其他可能的原因

1
<mapper namespace="me.tspace.pm.dao.UserDao">
 mapper的namespace写的不对!!!注意系修改。
2.UserDao的方法在UserDao.xml中没有,然后执行UserDao的方法会报此
3. UserDao的方法返回值是List<User>,而select元素没有正确配置ResultMap,或者只配置ResultType!
4. 如果你确认没有以上问题,请任意修改下对应的xml文件,比如删除一个空行,保存.问题解决…

 

9.mybatis批量更新,插入活删除操作时需要在jdbc的配置中加上&allowMultiQueries=true,否则会报奇奇怪怪的错误

10.vue跨域问题,在shiro拦截器里配置

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值