0
스프링 세션과 Aspectj를 사용하여 세션 직렬화 후 Redis로 @Autowired
필드를 다시 연결하려고합니다.org.springframework.beans.factory.wiring.BeanWiringInfo.BeanWiringInfo가 null 이름으로 초기화되었습니다.
@UIScope()
@SpringComponent(value = AboutView.VIEW_NAME)
@SpringView(name = AboutView.VIEW_NAME)
//
@Configurable(autowire = Autowire.BY_NAME, value = AboutView.VIEW_NAME, dependencyCheck = false, preConstruction = true)
public class AboutView extends AbstractView {
public static final String VIEW_NAME = "butterfly-effect-frontend-system:about";
private Table tableFrontEndInformation;
private GridLayout backendLayout;
private GridLayout frontendLayout;
@Autowired
private transient DiscoveryClient discoveryClient;
이 빈은 @Configurable과 빈 정의 (값)의 이름을 사용하고 있습니다 :
이
는 빈입니다. 불행하게도 aspect는 null bean 이름을 가진BeanWiringInfo
을 생성하고있다. 이것은 이름이 필요하기 때문에 에러를 발생시킬 것이다.
:이 오류가
protected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation) {
if (!Autowire.NO.equals(annotation.autowire())) {
return new BeanWiringInfo(annotation.autowire().value(), annotation.dependencyCheck());
}
else {
if (!"".equals(annotation.value())) {
// explicitly specified bean name
return new BeanWiringInfo(annotation.value(), false);
}
else {
// default bean name
return new BeanWiringInfo(getDefaultBeanName(beanInstance), true);
}
}
}
:
@Configurable(autowire = Autowire.BY_NAME, value = AboutView.VIEW_NAME, dependencyCheck = false, preConstruction = true)
오류가
/**
* Create a new BeanWiringInfo that points to the given bean name.
* @param beanName the name of the bean definition to take the property values from
* @param isDefaultBeanName whether the given bean name is a suggested
* default bean name, not necessarily matching an actual bean definition
* @throws IllegalArgumentException if the supplied beanName is {@code null},
* is empty, or consists wholly of whitespace
*/
public BeanWiringInfo(String beanName, boolean isDefaultBeanName) {
Assert.hasText(beanName, "'beanName' must not be empty");
this.beanName = beanName;
this.isDefaultBeanName = isDefaultBeanName;
}
AnnotationBeanWiringInfoResolver이 코드에서 BeanWiringInfo를 인스턴스화 AnnotationBeanWiringInfoResolver에 의해 호출되는 다음과 같은 생성자 인해 발생
Caused by: java.lang.IllegalArgumentException: 'name' must not be null
at org.springframework.util.Assert.notNull(Assert.java:115) ~[spring-core-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.BeanFactoryUtils.transformedBeanName(BeanFactoryUtils.java:72) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.transformedBeanName(AbstractBeanFactory.java:1109) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:970) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at com.vaadin.spring.internal.SpringViewDisplayPostProcessor.postProcessAfterInitialization(SpringViewDisplayPostProcessor.java:66) ~[classes/:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:423) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1594) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:400) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.wiring.BeanConfigurerSupport.configureBean(BeanConfigurerSupport.java:142) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect.configureBean(AnnotationBeanConfigurerAspect.aj:63) ~[spring-aspects-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.aspectj.AbstractDependencyInjectionAspect.ajc$before$org_springframework_beans_factory_aspectj_AbstractDependencyInjectionAspect$1$e854fa65(AbstractDependencyInjectionAspect.aj:79) ~[spring-aspects-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at com.scipionyx.butterflyeffect.frontend.configuration.ui.view.AboutView.<init>(AboutView.java:72) ~[classes/:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_45]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_45]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_45]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_45]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
... 107 common frames omitted
누구든지이 구성에서 무엇이 잘못 될 수 있는지 알고 있습니까?
귀하의 도움에 감사드립니다.