为了账号安全,请及时绑定邮箱和手机立即绑定

运行时出错

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Dec 18 10:46:47 PST 2018

There was an unexpected error (type=Internal Server Error, status=500).

Invalid bound statement (not found): com.miaoshaproject.dao.UserDOMapper.selectByPrimaryKey


正在回答

5 回答

配置文件会不会写错了 mybatis.mapper-locations=classpath:mapping/*.xml


0 回复 有任何疑惑可以回复我~

mybatis-generater.xml中的connectionURL,加参数&nullCatalogMeansCurrent=true:

然后执行,userDOMapper.xml 里面就会有selectByPrimaryKey

<!--数据库链接地址账号密码-->

<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
               connectionURL="jdbc:mysql://localhost:3306/miaosha?useUnicode=true&amp;characterEncoding=utf8&amp;serverTimezone=GMT&amp;nullCatalogMeansCurrent=true"
               userId="root"
               password="root">
</jdbcConnection>


0 回复 有任何疑惑可以回复我~

那你看下 USERDOMapper.xml 里面的 namespace 是不是写错了

0 回复 有任何疑惑可以回复我~

userDOMapper.xml 里面没有 selectByPrimaryKey

0 回复 有任何疑惑可以回复我~
#1

慕容9033451 提问者

有的啊,但是不知道为什么找不到
2018-12-20 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
SpringBoot构建电商基础秒杀项目
  • 参与学习       48694    人
  • 解答问题       950    个

应用SpringBoot快速搭建拥有用户、商品、交易及秒杀活动的电商秒杀应用。

进入课程

运行时出错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信