当前位置:网站首页>Problems encountered in the project and Solutions

Problems encountered in the project and Solutions

2022-07-23 18:12:00 Joy's sister is a rookie

Question 1

Report errors :

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)}

** reason :** No import mapper.xml

Question two

** Report errors :**404 Failed to enter method

** reason :** stay Controller No comments in @ResponseBody

Question 3

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-dNcFy2ll-1658541859925)(C:\Users\pon18\AppData\Roaming\Typora\typora-user-images\image-20220722162034643.png)]

Use jackson Encountered in the process of transferring data to the browser 406, The browser can't understand the data you send (List object )

Check the problem and find that it is not turned on mvc Annotation driven

stay spring Medium configuration is ok

<mvc:annotation-driven></mvc:annotation-driven>-->

Question 4

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-OVHHIawb-1658541859926)(C:\Users\pon18\AppData\Roaming\Typora\typora-user-images\image-20220722162016972.png)]

Error message :Uncaught ReferenceError: $ is not defined

The reason is that I wrote :

<script src="js.jquery.js"></script>

The right thing to do is :

<script src="js/jquery.js"></script>

Question five

When the browser performs query operations , Enter in the address field username and password After that, you can't get the right result .User The property name of is userName, Enter in the input field ,userName Automatic change username

Because maybe it went cache , So change n

At this time, copy and paste in other text and change it to userName Re-enter

http://localhost:8080/shoppingCart2_war/user/login.do?userName=liguocheng&password=12345

Question 6

stay html Import BootStrap frame , But the style cannot be displayed on the page , Clean cache target, Rerun .

Question seven

Console error :

Field userMapper in com.lanou.springboot.service.UserService required a bean of type  com.lanou.springboot.mapper.UserMapper  that could not be found.

Add on the startup class @MapperScan("com.lanou.springboot.mapper")

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-4scLM24e-1658541888620)(C:\Users\pon18\AppData\Roaming\Typora\typora-user-images\image-20220723093643655.png)]

原网站

版权声明
本文为[Joy's sister is a rookie]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207231420228038.html