当前位置:网站首页>Some mistakes that Xiaobai often makes (update from time to time, and promise not to make them again next time)
Some mistakes that Xiaobai often makes (update from time to time, and promise not to make them again next time)
2022-07-24 08:39:00 【Xiao Li, who loves traveling】
Some mistakes Xiaobai often makes ( Update from time to time , Promise not to do it again )
List of articles
Preface :
This is an error correction article , Record all kinds of codes of Xiaobai at ordinary times debug daily , Xiaobai once encountered these bug, It took a lot of time , In order not to make low-level mistakes , Write this article specially .
If you like, you can like the collection , Level co., LTD. , Welcome to error correction .

problem 1:SpringBoot Project startup failed !
Error message :
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eduCommentController': Unsatisfied dependency expressed through field 'uCenterClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atguigu.eduservice.client.UCenterClient': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: No fallback instance of type class com.atguigu.eduservice.client.impl.UCenterClientImpl found for feign client service-ucenter
Error type :
org.springframework.beans.factory.UnsatisfiedDependencyException
reason :
Not in the Feign Add... To the implementation class of the remote call class @Service annotation , As a result, this class is not added Spring Containers , initialization failed !
Solution :
Add @Service annotation
problem 2: Front page 404
Error message :

Error type :
Failed to load resource: the server responded with a status of 500 (NuxtServerError)
NuxtServerError
Request failed with status code 404
reason :
Appear this kind of 404 Errors are generally 2 One reason , Or the back-end code is missing , Or the address of the previous call is written incorrectly .
I am here api The calling address is wrong 
Solution :
// According to instructor ID Inquire about lecturer information and courses
getTeacherInfo(teacherId){
return request({
url: '/eduservice/front/teacher/getTeacherInfo/' + teacherId,
method: 'get'
})
}
problem 3:org.springframework.web.HttpRequestMethodNotSupportedException: Request method ‘GET’ not supported
Error message :
Back end :
org.springframework.web.HttpRequestMethodNotSupportedException: Request method ‘GET’ not supported
front end :
Uncaught (in promise) Error: Network Error
at createError (createError.js?2d83:16)
at XMLHttpRequest.handleError (xhr.js?b50d:83)
Error type :
org.springframework.web.HttpRequestMethodNotSupportedException
reason :
There is no error in the back-end interface , There is an error in the request mode when calling the front end 
Solution :
take get The request was changed to post request
// Paging query
getTeacherPage(page,limit){
return request({
url: `/eduservice/front/teacher/getTeacherPage/${
page}/${
limit}`,
method: 'post'
})
},
problem 4: Paging query does not return data
Error message :
Back end :
There was no error at first , But will http://localhost:9001/eduservice/front/course/getCoursePage/1/8 After copying the manual request, an error is found
java.lang.NullPointerException
at com.atguigu.eduservice.service.impl.EduCourseServiceImpl.getCourseFrontPage(EduCourseServiceImpl.java:169)
front end :
You can see that the front end failed to call the back-end interface , Copy the middle post Submission found that the back end reported a null pointer exception
Error type :
java.lang.NullPointerException
reason :
You can find . The method for get Submit , But there's a @RequestBody Annotated parameters ,@RequestBody Comments need to be passed in json data , obviously get What cannot be done when submitting , Need to change to post Submit .
Solution :
It is amended as follows post Submit
// Conditional query with paging query course
@PostMapping("/getCoursePage/{page}/{limit}")
@ApiOperation(" Conditional query with paging query course ")
public R getCoursePage(@PathVariable long page, @PathVariable long limit,
@RequestBody(required = false) CourseDetailVo courseDetailVo){
Page<EduCourse> coursePage = new Page<>(page, limit);
Map<String,Object> map = courseService.getCourseFrontPage(coursePage, courseDetailVo);
return R.ok().data(map);
}
debug daily , Update from time to time ...
边栏推荐
- Wechat official account configures custom menu jump applet and automatically replies to jump applet
- dba
- Kotlin learning note 1 - variables, functions
- Read and understand move2earn project - move
- 4、 Midway integrates swagger and supports JWT bearers
- Play to earn: a new and more promising game paradigm in the future
- 【一起上水硕系列】June总结+no 焦虑+July计划+如何考试+如何提升
- Musk responded that the brain has been uploaded to the cloud: already did it!
- Beandefinition three ways to load beans
- Error lnk2019: unresolved external symbol [email protected]
猜你喜欢

Hack the box - Introduction to networking module detailed Chinese tutorial

2022.7.11 overall solution

From starfish OS' continued deflationary consumption of SFO, the value of SFO in the long run

【MySQL】08:聚合函数

3587. Connected graph (Jilin University postgraduate entrance examination machine test question)
![[technical interview] how to introduce yourself](/img/2e/775e4ba577098f7465309f772ee591.png)
[technical interview] how to introduce yourself

「题解」火神之友

3587. 连通图(吉林大学考研机试题)

Wargames NATAS (0-10) problem solving essay

Read and understand move2earn project - move
随机推荐
MySQL counts the total sales data of each month
Php+spool to realize the shell client of web version
[wechat applet development] (I) development environment and applet official account application
From starfish OS' continued deflationary consumption of SFO, the value of SFO in the long run
Look at the most influential infrastructure m-dao of Web3 through the current situation of Dao
Dao race track is booming. What are the advantages of m-dao?
Wechat applet file types and functions
How to write your FAQ page?
5、 Use of environment variables in midway
WordPress free theme: document, making reading more convenient
"Problem solution" with score
Mysql database advanced
【一起上水硕系列】EE feedback 详解
In the next bull market, can platofarm, the leading project in the Web3 world, set foot on the top of the mountain
Use the bark app to realize the process of pushing messages to mobile phones
Hack the box - Introduction to networking module detailed Chinese tutorial
Porting boa server on imx6ull
Kotlin learning note 1 - variables, functions
Treap
Typescript -- Generic