问题一
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.lanou.mapper.GoodsMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.lanou.mapper.GoodsMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
**原因:**没导入mapper.xml
问题二
**报错:**404进入方法失败
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-2sTWakuv-1663400762221)(C:\Users\MAD95\AppData\Roaming\Typora\typora-user-images\image-20220917154119278.png)]](https://i-blog.csdnimg.cn/blog_migrate/ed0f3718d01e61cc82d81df02c62498a.png)
**原因:**在Controller中没有注解@ResponseBody
问题三
使用jackson传数据到浏览器过程中遇到406,浏览器看不懂你传送的数据(List对象)
查看问题发现是没有开启mvc的注解驱动
在spring中配置即可
<mvc:annotation-driven></mvc:annotation-driven>-->
问题四
报错信息:Uncaught ReferenceError: $ is not defined
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-5RR0xZ6p-1663400762223)(C:\Users\MAD95\AppData\Roaming\Typora\typora-user-images\image-20220917154212626.png)]](https://i-blog.csdnimg.cn/blog_migrate/c70cf052608248fecdfc378d008993a2.png)
原因是我写的:
正确应该是:
问题五
在浏览器执行查询操作的时候,在地址栏输入username和password之后始终得不到正确的结果。User的属性名是userName,在输入栏输入后,userName自动变username
因为可能它走了缓存,所以变n
此时在其他文本中复制粘贴修改为userName再重新输入即可
http://localhost:8080/shoppingCart2_war/user/login.do?userName=liguocheng&password=12345
问题六
在html中导入BootStrap框架,但是始终无法在页面显示出来样式,清理缓存target,重新运行。
问题七
控制台出现错误:
Field userMapper in com.lanou.springboot.service.UserService required a bean of type com.lanou.springboot.mapper.UserMapper that could not be found.
在启动类上添加@MapperScan(“com.lanou.springboot.mapper”)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-76FzBgTo-1663400762224)(C:\Users\MAD95\AppData\Roaming\Typora\typora-user-images\image-20220917154352332.png)]](https://i-blog.csdnimg.cn/blog_migrate/325677ce8f0d0eb084ae5f2420963a67.png)
问题八
报错
Optional int parameter 'id' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.
解决
①Mapper层写的@param,在mapper.xml文件中获取时写错了。只有当param为对象时,才会点它的属性
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jpyZIE1M-1663400762225)(C:\Users\MAD95\AppData\Roaming\Typora\typora-user-images\image-20220917154417077.png)]](https://i-blog.csdnimg.cn/blog_migrate/11de6bff7e34e35c42339e960597eec2.png)
②前端页面写的ajax请求data中有误

问题九
Description:
Field mapper in com.lanou.jwtauth.service.impl.UserService required a bean of type 'com.lanou.jwtauth.mapper.UserMapper' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.lanou.jwtauth.mapper.UserMapper' in your configuration.
在启动类上添加注解@MapperScan(“com.lanou.jwtauth.mapper”)
问题十
页面报500
front报错信息如下:
feign.FeignException$InternalServerError: [500] during [POST] to [http://jwtauth/user/login.do] [AuthClient#login(UserToken)]: [{"timestamp":"2022-08-02T12:47:51.077+00:00","status":500,"error":"Internal Server Error","message":"","path":"/user/login.do"}]
at feign.FeignException.serverErrorStatus(FeignException.java:231) ~[feign-core-10.10.1.jar:na]
......
说明问题在auth,应在auth的控制台中查看报错
4962

被折叠的 条评论
为什么被折叠?



