@RestController
@RequestMapping(value = "/develop")
@Configuration
public class DevelopController {
@Resource(name = "smsService")
private SmsService smsService;
@RequestMapping(value = "/verification/selectAuthVerifyCode", method = RequestMethod.GET, produces = Constant.APP_JSON)
@Bean
@Profile({"local"})
public @ResponseBody AuthVerifyCodeO selectAuthVerifyCode(
@RequestParam(value="callingCode", required=true) String callingCode
, @RequestParam(value="regionPhoneNumber", required=true) String regionPhoneNumber
) throws Exception {
AuthVerifyCodeO result = new AuthVerifyCodeO();
result = smsService.selectAuthVerifyCode(callingCode, regionPhoneNumber);
return result;
}
}
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'selectAuthVerifyCode' defined in class path resource [com/test/scheduler/executor/DevelopController.class]: Unsatisfied dependency expressed through method 'selectAuthVerifyCode' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.lang.String' available: expected at least 1 bean which qualifies as autowire candidate
我想@Profile在方法级别上使用但发生错误我该如何解决这个问题?