Код: Выделить всё
@Configuration
public class Config {
@Bean
public void faultyBean() {
System.out.println("Hello");
}
}
Код: Выделить всё
@Bean method 'init' must not be declared as void
Код: Выделить всё
public class ABCConfig implements InitializingBean, DisposableBean {
@Override
public void destroy() throws Exception {
// destory
}
@Override
public void afterPropertiesSet() throws Exception {
// initializing
}
}
Код: Выделить всё
@Bean(name = "ABC")
public ABCConfig init() {
return new ABCConfig();
}
Подробнее здесь: https://stackoverflow.com/questions/781 ... eturn-type
Мобильная версия