Reason: Failed to determine a suitable driver class.
Solution:
2. The class exists, but spring has not scanned it. Pay attention to the location of the startup class, springboot By default, the subpackages and classes in the directory where the startup class is located are scanned, as shown in Figure 1.2 below. In addition, you can use the @componentScan annotation to specify the package to be scanned: Example @componentScan ({"xxx.xx", "xxx.xx"})
2. Due to the bean The relationship between loading order and configuration files
https://www.yisu.com/article/222850.htm
https:// www.yisu.com/article/190698.htm
https://www.yisu.com/article/229466.htm
Supplement: Springboot startup error and other files have wrong versions 61.0, should be 52.0
Class file has wrong version 61.0, should be 52.0
Please delete the file or make sure it is in the correct classpath subdirectory.
Reason
Reduce the SpringBoot version to below 3.0. The version is optional, just refresh Maven and restart.
The above is the detailed content of Springboot startup error bean cannot be found, how to solve it. For more information, please follow other related articles on the PHP Chinese website!