ERROR [main] org.springframework.test.context.TestContextManager [250] -| Caught exception while all

-ERROR [main] org.springframework.test.context.TestContextManager [250] -| Caught exception while allowing TestExecutionListener [org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@5a63f509] to prepare test instance [com.fit.FitApplicationTests@61f80d55]
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.fit.FitApplicationTests': Unsatisfied dependency expressed through field 'actMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.fit.mapper.ActMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

 

 

解决:加 @MapperScan(value={"com.fit.mapper"}) 在XXXApplication类上:

@SpringBootApplication
@MapperScan(value={"com.fit.mapper"})
public class FitApplication {

	public static void main(String[] args) {
		SpringApplication.run(FitApplication.class, args);
	}

}

 

你可能感兴趣的:(SSM框架,Java)