我们在一个小项目中试用Vaadin14,我们有自己的CDI插件,但是现在在V14中出现了问题,我想不通为什么。
主持人类。
@SuppressWarnings("serial")
@Dependent
public abstract class AbstractMVPPresenter<T extends MVPView> implements
Serializable, MVPPresenter {
private transient Logger logger = Logger.getLogger(getClass().getName());
@Inject
private Instance<MVPView> viewInstance;
protected T view;
public static final String VIEW_ENTER = "AbstractPresenter_ve";
@PostConstruct
protected void postConstruct() {
// ViewInterface must be defined
final Class<? extends MVPView> viewInterface = getClass()
.getAnnotation(ViewInterface.class).value();
view = (T) viewInstance.select(viewInterface).get();
logger.info("Presenter initialized: " + getClass());
}
/**
* Performs view actions called each time the view is entered.
*/
public abstract void viewEntered();
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public static @interface ViewInterface {
Class<? extends MVPView> value();
}
}
其他类的问题。
视图。
public interface View extends MVPView
public abstract class ViewImpl extends AbstractMVPView implements View
public interface MainView extends View
@RouteScoped
public class MainViewImpl extends ViewImpl implements MainView
@AbstractMVPPresenter.ViewInterface(MainView.class)
public class MainPresenter extends AbstractMVPPresenter<MainView>
问题是在viewInstance.get()方法中,好像没有注入任何实例,我得到一个WELD-000049。
Caused by: org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke public void hu.otpbank.MainViewImpl.init() on hu.otpbank.MainViewImpl@555863f4
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:85)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.bean.builtin.InstanceImpl.getBeanInstance(InstanceImpl.java:252)
at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:114)
at org.vaadin.addon.cdimvp.AbstractMVPPresenter.postConstruct(AbstractMVPPresenter.java:45)
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:723)
at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:86)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:145)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:106)
at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
at org.jboss.weld.util.Observers.notify(Observers.java:166)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
at org.vaadin.addon.cdimvp.ViewComponent.fireViewEvent(ViewComponent.java:19)
at hu.otpbank.common.ViewImpl.fireViewEvent(ViewImpl.java:104)
at org.vaadin.addon.cdimvp.AbstractMVPView.enter(AbstractMVPView.java:31)
at hu.otpbank.common.ViewImpl.enter(ViewImpl.java:109)
at hu.otpbank.MainViewImpl.init(MainViewImpl.java:69)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:723)
at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:86)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:145)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:106)
at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
at org.jboss.weld.util.Observers.notify(Observers.java:166)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
at org.vaadin.addon.cdimvp.ViewComponent.fireViewEvent(ViewComponent.java:19)
at hu.otpbank.common.ViewImpl.fireViewEvent(ViewImpl.java:105)
at org.vaadin.addon.cdimvp.AbstractMVPView.enter(AbstractMVPView.java:31)
at hu.otpbank.common.ViewImpl.enter(ViewImpl.java:110)
at hu.otpbank.MainViewImpl.createUserDataBlock(MainViewImpl.java:90)
at hu.otpbank.MainViewImpl.init(MainViewImpl.java:79)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.bean.builtin.InstanceImpl.getBeanInstance(InstanceImpl.java:252)
at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:114)
at org.vaadin.addon.cdimvp.AbstractMVPPresenter.postConstruct(AbstractMVPPresenter.java:46)
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:723)
at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:86)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:145)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:106)
at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
at org.jboss.weld.util.Observers.notify(Observers.java:166)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
at org.vaadin.addon.cdimvp.ViewComponent.fireViewEvent(ViewComponent.java:19)
at hu.otpbank.common.ViewImpl.fireViewEvent(ViewImpl.java:105)
at org.vaadin.addon.cdimvp.AbstractMVPView.enter(AbstractMVPView.java:31)
at hu.otpbank.common.ViewImpl.enter(ViewImpl.java:110)
at hu.otpbank.MainViewImpl.createUserDataBlock(MainViewImpl.java:90)
at hu.otpbank.MainViewImpl.init(MainViewImpl.java:79)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.bean.builtin.InstanceImpl.getBeanInstance(InstanceImpl.java:252)
at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:114)
at org.vaadin.addon.cdimvp.AbstractMVPPresenter.postConstruct(AbstractMVPPresenter.java:46)
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:723)
at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:86)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:145)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:106)
at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
at org.jboss.weld.util.Observers.notify(Observers.java:166)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
at org.vaadin.addon.cdimvp.ViewComponent.fireViewEvent(ViewComponent.java:19)
at hu.otpbank.common.ViewImpl.fireViewEvent(ViewImpl.java:105)
at org.vaadin.addon.cdimvp.AbstractMVPView.enter(AbstractMVPView.java:31)
at hu.otpbank.common.ViewImpl.enter(ViewImpl.java:110)
at hu.otpbank.MainViewImpl.createUserDataBlock(MainViewImpl.java:90)
at hu.otpbank.MainViewImpl.init(MainViewImpl.java:79)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.bean.builtin.InstanceImpl.getBeanInstance(InstanceImpl.java:252)
at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:114)
at org.vaadin.addon.cdimvp.AbstractMVPPresenter.postConstruct(AbstractMVPPresenter.java:46)
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:723)
at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:86)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:145)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:106)
at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
at org.jboss.weld.util.Observers.notify(Observers.java:166)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
at org.vaadin.addon.cdimvp.ViewComponent.fireViewEvent(ViewComponent.java:19)
at hu.otpbank.common.ViewImpl.fireViewEvent(ViewImpl.java:105)
at org.vaadin.addon.cdimvp.AbstractMVPView.enter(AbstractMVPView.java:31)
at hu.otpbank.common.ViewImpl.enter(ViewImpl.java:110)
at hu.otpbank.MainViewImpl.createUserDataBlock(MainViewImpl.java:90)
at hu.otpbank.MainViewImpl.init(MainViewImpl.java:79)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.bean.builtin.InstanceImpl.getBeanInstance(InstanceImpl.java:252)
at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:114)
at org.vaadin.addon.cdimvp.AbstractMVPPresenter.postConstruct(AbstractMVPPresenter.java:46)
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:723)
at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:86)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:145)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:106)
at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
at org.jboss.weld.util.Observers.notify(Observers.java:166)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
at org.vaadin.addon.cdimvp.ViewComponent.fireViewEvent(ViewComponent.java:19)
at hu.otpbank.common.ViewImpl.fireViewEvent(ViewImpl.java:105)
at org.vaadin.addon.cdimvp.AbstractMVPView.enter(AbstractMVPView.java:31)
at hu.otpbank.common.ViewImpl.enter(ViewImpl.java:110)
at hu.otpbank.MainViewImpl.createUserDataBlock(MainViewImpl.java:90)
at hu.otpbank.MainViewImpl.init(MainViewImpl.java:79)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.bean.builtin.InstanceImpl.getBeanInstance(InstanceImpl.java:252)
at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:114)
at org.vaadin.addon.cdimvp.AbstractMVPPresenter.postConstruct(AbstractMVPPresenter.java:46)
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:66)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:131)
at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
at com.vaadin.cdi.context.ContextWrapper.get(ContextWrapper.java:50)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:723)
at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:86)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:145)
at org.vaadin.addon.cdimvp.MVPExtension$1.notify(MVPExtension.java:106)
at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
at org.jboss.weld.util.Observers.notify(Observers.java:166)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
at org.vaadin.addon.cdimvp.ViewComponent.fireViewEvent(ViewComponent.java:19)
at hu.otpbank.common.ViewImpl.fireViewEvent(ViewImpl.java:105)
at org.vaadin.addon.cdimvp.AbstractMVPView.enter(AbstractMVPView.java:31)
at hu.otpbank.common.ViewImpl.enter(ViewImpl.java:110)
at hu.otpbank.MainViewImpl.createUserDataBlock(MainViewImpl.java:90)
at hu.otpbank.MainViewImpl.init(MainViewImpl.java:79)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
在Vaadin8中工作得很好,不知道是什么改变导致了错误。
这个问题是由我的视图的init方法引起的。它与@PostConstruct一起使用,造成了CDI的问题。ViewEnter也改成了Vaadin14事件。