Error:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-06-28 14:27:13.827 ERROR 7512 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
Background
It’s time to review. The teacher asked me to write a springboot project, but I couldn’t run it. Running application shows that application cannot be run
some errors were encountered in the process. I searched Baidu, and the result is as follows:
in the annotation of application, there is @ springbootapplication
, which should be replaced by @ springbootapplication (exclude = datasourceautoconfiguration. Class)
, but the result still doesn’t work.
Exclude to exclude such autoconfig, that is, to prohibit springboot from automatically injecting data source configuration. In this case, the automatic injection of mybits is excluded. As a result, there is a problem in the mapper layer.
Let the teacher have a look today. There is something wrong with the YML file.
Forget to write
spring
keywords, which I don’t understand.
server:
port: 5050 # tomcat port
servlet:
context-path: /UserModel
spring:# I forgot to write it here, so that datesource belongs to the server
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/1202?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf-8
username: root
password: root
An error occurred while accessing the controller
The error reported is the same as this:
would dispatch back to the current handler URL [/UserModel/queryUserById]
The difference between @Controller
and @RestController
is actually confusing
@Controller
, @RestController
?
Forgot the difference between get and post
Written by.
http://localhost:5050/UserModel/deleteUserByIds?ids=3,4
Read More:
- [Solved] Bat starts springboot project error: ERROR org.springframework.boot.SpringApplication -Application run failed
- SpringBoot Error running ‘Application’: Command line is too long.Shorten command line for
- [Solved] Idea Run Error: Error running ‘Application‘: Command line is too long
- [Solved] Springboot project Create to start Error: APPLICATION FAILED TO START
- Spring-boot Use dubbo Error: ERROR 8404 o.s.boot.SpringApplication:Application run failed
- [Solved] SpringBoot Error: HttpMediaTypeNotSupportedException: Content type ‘application/json‘ not supported
- Commit failed – exit code 1 received, with output: ‘>running pre-commit hook: npm run precommit (Fixed)
- [Solved] SpringBoot Error: This application has no explicit mapping for /error, so you are seeing this
- Springboot Run Error: java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Handler
- SpringBoot startup error Failed to determine a suitable driver class
- [Solved] Springboot Project Startup Error: Error running XXX. Command line is too long.
- Clion new method shows undefined reference to solution
- [Solved] Error running ‘go build myfir_go_project‘: Cannot run program
- [Solved] “Failed to run kubelet“ err=“failed to run Kubelet: misconfiguration: kubelet cgroup driver: \“cgrou
- Spark-shell startup error: Yarn application has already ended! It might have been killed or unable to launch application master
- [Solved] Failed to load property source from location ‘classpath:/application.yml‘
- [Solved] SpringBoot Integrates Swagge Error: Failed to start bean ‘documentationPluginsBootstrapper‘
- SpringBoot High Version Import Swagger 2.9.2 Error: ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper‘
- _LSOpenURLsWithCompletionHandler() failed for the application xxx with error -10671 [Solved]
- [Solved] Springboot Error: org.apache.catalina.core.ContainerBase : A child container failed during start