解决:Failed to load ApplicationContext
Generally follow the steps below to solve
Step 1: Check the annotations
Check if there are the following annotations
@RunWith(SpringRunner.class)
@SpringBootTest
If not, add dependencies and add comments
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
Step 2: Check the package name
Check whether the package name or package path in the xml file is correct, because the bean is configured through xml. For those that cannot be loaded, usually start with the xml file that is injected into the container.
Example:
Step 3: Check the encoding format
setting
application.yml