***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 2 of constructor in com.casic.cplm.esp.web.EspSearchController required a bean of type 'com.casic.cplm.esp.web.EspSearchController' that could not be found.
Action:
Consider defining a bean of type 'com.casic.cplm.esp.web.EspSearchController' in your configuration.
此报错是因为EspSearchController中有bean没有被找到,未被找到的原因为注解**@ConditionalOnBean和注解@ConditionalOnClass**导致的
原代码为:
@RestController
@ConditionalOnBean({EspEngineService.class, EspSearchService.class})
@ConditionalOnClass(RedisTemplate.class)
public class EspSearchController {
private static final Logger LOGGER = LoggerFactory.getLogger(EspSearchController.class);
private static final String TEXT = "text";
private final EspEngineService espEngineService;
private final EspSearchService espSearchService;
private final EspSearchDataService espSearchDataService;
private final EspSchemaService espSchemaService;
private final List<SearchResultBuilder> searchResultBuilders;
private final UserService userService;
private final EspAuditService auditService;
private final SearchRedisHelper searchRedisHelper;
private final CategoryService categoryService;
@Value("${com.casic.cplm.forceAccess:false}")
private Boolean forceAccess;