Home > Back-end >  For spring test maven project
For spring test maven project

Time:12-05

Caught exception while allowing TestExecutionListener [org. Springframework. Test. The context. Support. DependencyInjectionTestExecutionListener @ 2 ed94a8b] to prepare the test instance [com. Guigu. Test. MapperTest @ 72 d6b3ba]
Java. Lang. An IllegalStateException: Failed to load ApplicationContext
The at org. Springframework. Test. The context. Cache. DefaultCacheAwareContextLoaderDelegate. LoadContext (DefaultCacheAwareContextLoaderDelegate. Java: 124)
The at org. Springframework. Test. The context. Support. DefaultTestContext. GetApplicationContext (DefaultTestContext. Java: 83)
The at org. Springframework. Test. The context. Support. DependencyInjectionTestExecutionListener. InjectDependencies (DependencyInjectionTestExecutionListener. Java: 117)
The at org. Springframework. Test. The context. Support. DependencyInjectionTestExecutionListener. PrepareTestInstance (DependencyInjectionTestExecutionListener. Java: 83)
The at org. Springframework. Test. The context. TestContextManager. PrepareTestInstance (TestContextManager. Java: 230)
The at org. Springframework. Test. The context. Takeup. SpringJUnit4ClassRunner. CreateTest (SpringJUnit4ClassRunner. Java: 228)
The at org. Springframework. Test. The context. Takeup. SpringJUnit4ClassRunner $1. RunReflectiveCall (SpringJUnit4ClassRunner. Java: 287)
The at org. Junit. Internal. Runners. Model. ReflectiveCallable. Run (ReflectiveCallable. Java: 12)
The at org. Springframework. Test. The context. Takeup. SpringJUnit4ClassRunner. MethodBlock (SpringJUnit4ClassRunner. Java: 289)
The at org. Springframework. Test. The context. Takeup. SpringJUnit4ClassRunner. RunChild (SpringJUnit4ClassRunner. Java: 247)
The at org. Springframework. Test. The context. Takeup. SpringJUnit4ClassRunner. RunChild (SpringJUnit4ClassRunner. Java: 94)
The at org. Junit. Runners. ParentRunner $3. The run (ParentRunner. Java: 290)
The at org. Junit. Runners. ParentRunner $1. The schedule (ParentRunner. Java: 71)
The at org. Junit. Runners. ParentRunner. RunChildren (ParentRunner. Java: 288)
The at org. Junit. Runners. ParentRunner. Access the $000 (ParentRunner. Java: 58)
At org. Junit. Runners. ParentRunner $2. The evaluate (ParentRunner. Java: 268)
The at org. Springframework. Test. The context. Takeup. Statements. RunBeforeTestClassCallbacks. Evaluate (RunBeforeTestClassCallbacks. Java: 61)
The at org. Springframework. Test. The context. Takeup. Statements. RunAfterTestClassCallbacks. Evaluate (RunAfterTestClassCallbacks. Java: 70)
The at org. Junit. Runners. ParentRunner. Run (ParentRunner. Java: 363)
The at org. Springframework. Test. The context. Takeup. SpringJUnit4ClassRunner. Run (SpringJUnit4ClassRunner. Java: 191)
At org. Eclipse JDT. I

CodePudding user response:

Before feeling may be related to reverse engineering, reverse before it without useSSL=false, now have to add to the reverse, but tests is Fried, wow mentality explosion for help great god ~ ~ (also did not move ahhh mysql version)

CodePudding user response:

"Failed to load ApplicationContext
"Could it be that you load the spring configuration file write wrong? Address configuration file or configuration file content!

CodePudding user response:

Configuration file has a problem, no load

CodePudding user response:

refer to the second floor changerzhuo_319 response:
"Failed to load ApplicationContext"
Could it be that you load the spring configuration file write wrong? Address configuration file or configuration file content!


Was not wrong to feel this path...

CodePudding user response:

Configuration file is not loaded into the, use the @ ImportResource (locations={" classpath: XXX. XML "}) try to load the specified configuration file; Generally do not recommend using an XML file, switch to use configuration class,
  • Related