Однако по какой-то причине подкласс DraftsPostMethod сообщает о том, что нет найден конструктор по умолчанию в родительском классе AbstractContributoryServiceMethod
Я не уверен, что является причиной этого, потому что я сделал то же самое (добавил аннотацию) для других классов, чтобы инициализировать их способом Lombok.
Подкласс сообщает об ошибке: «В ... AbstractContributoryServiceMethod нет доступного конструктора по умолчанию»
Подкласс:
Код: Выделить всё
@Service
public class DraftsPostMethod extends AbstractContributoryServiceMethod {
private final Validator validator = new Validator(){
@Nonnull
@Override
public ValidationState validate(DraftManagementRequest draftManagementRequest){
return ValidationState.commence();
}
};
private final DraftService draftService;
@Autowired
public DraftsPostMethod(DraftService draftService){ // getting the red line error here
this.draftService = draftService;
}
//...and so on...
}
Код: Выделить всё
@RequiredArgsConstructor
public abstract class AbstractContributoryServiceMethod {
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
private final ExceptionManager exceptionManager; //this line was @Autowired private ExceptionManager exceptionManager
private final ValidationErrorTranslator validationErrirTranslator; //this line was @Autowired private ValidationErrorTranslator validationErrirTranslator
private final ExceptionDetailsLogger exceptionDetailsLogger; //this line was @Autowired private ExceptionDetailsLogger exceptionDetailsLogger
//... and so on...
}
Подробнее здесь: https://stackoverflow.com/questions/661 ... -finding-d
Мобильная версия