org.springframework.beans.factory.BeanCreationException при весеннем обновлении загрузки с версии 1.5 до версии 2.1 - PullRequest
0 голосов
/ 14 февраля 2020

В моем приложении Spring Boot я получаю сообщение об ошибке при обновлении Spring Boot с версии 1.5 до 2.1:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pushNotificationsController': Unsatisfied dependency expressed through field 'pushNotificationUtil'; 

nested exception is 

org.springframework.beans.factory.UnsatisfiedDependencyException: 

Error creating bean with name 'pushNotificationsUtil': Unsatisfied dependency expressed through field 'pushNotificationFeignClient'; 

nested exception is 

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.xyz.abd.service.PushNotificationFeignClient': FactoryBean threw exception on object creation; 

nested exception is java.lang.UnsupportedOperationException
    at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
    at 

org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)

Я делюсь исходным кодом ниже:

@SpringBootApplication
@EnableDiscoveryClient
EnableCircuitBreaker
@ServletComponentScan
@EnableCaching
@ComponentScan({"com.abc.upoint","com.def.portal"})
@EnableFeignClients
public class Application {

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

PushNotificationsController. java:

@RestController
public class PushNotificationsController {

  @Autowired
  private PushNotificationsUtil pushNotificationUtil;
}

PushNotificationsUtil. java:

@Component
public class PushNotificationsUtil {

    @Autowired
    private PushNotificationFeignClient pushNotificationFeignClient;
}

PushNotificationFeignClient. java:

import org.springframework.cloud.openfeign.FeignClient;

@FeignClient(name="channel-pushnotifications", url = "${onesignal.url:#{''}}", fallback = 
PushNotificationFeignClient.PushNotificationFallback.class
                                      , configuration=UpointFeignProxyConfiguration.class)
public interface PushNotificationFeignClient {

    class PushNotificationFallback implements PushNotificationFeignClient {
       // Method Implementations
    }

}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...