spring - Vaadin error "Scope 'vaadin-view' is not active for the current thread" -


i'm trying create vaadin 7.5.5 app add-on com.vaadin.vaadin-spring.1.0.0. not spring boot app, deploy-able war spring context should bootstrap vaadin.

the error is:

scope 'vaadin-view' not active current thread

nested exception java.lang.illegalstateexception: no active view

here full error trace:

2015-09-25 21:27:33 debug defaultlistablebeanfactory:448 - creating instance of bean 'vaadinspringapplication' 2015-09-25 21:27:33 debug injectionmetadata:72 - registered injected element on class [com.myapp.vaadin.demo.vaadinspringapplication]: autowiredfieldelement com.vaadin.spring.navigator.springviewprovider com.myapp.vaadin.demo.vaadinspringapplication.viewprovider 2015-09-25 21:27:33 debug injectionmetadata:72 - registered injected element on class [com.myapp.vaadin.demo.vaadinspringapplication]: autowiredfieldelement com.myapp.vaadin.demo.defaultview com.myapp.vaadin.demo.vaadinspringapplication.defaultview 2015-09-25 21:27:33 debug injectionmetadata:72 - registered injected element on class [com.myapp.vaadin.demo.vaadinspringapplication]: autowiredfieldelement com.myapp.vaadin.demo.springloginview com.myapp.vaadin.demo.vaadinspringapplication.springloginview 2015-09-25 21:27:33 debug injectionmetadata:72 - registered injected element on class [com.myapp.vaadin.demo.vaadinspringapplication]: autowiredfieldelement com.myapp.vaadin.demo.springmainview com.myapp.vaadin.demo.vaadinspringapplication.springmainview 2015-09-25 21:27:33 debug injectionmetadata:86 - processing injected element of bean 'vaadinspringapplication': autowiredfieldelement com.vaadin.spring.navigator.springviewprovider com.myapp.vaadin.demo.vaadinspringapplication.viewprovider 2015-09-25 21:27:33 debug defaultlistablebeanfactory:250 - returning cached instance of singleton bean 'viewprovider' 2015-09-25 21:27:33 debug autowiredannotationbeanpostprocessor:490 - autowiring type bean name 'vaadinspringapplication' bean named 'viewprovider' 2015-09-25 21:27:33 debug injectionmetadata:86 - processing injected element of bean 'vaadinspringapplication': autowiredfieldelement com.myapp.vaadin.demo.defaultview com.myapp.vaadin.demo.vaadinspringapplication.defaultview 2015-09-25 21:27:33 debug defaultlistablebeanfactory:448 - creating instance of bean 'viewcache' 2015-09-25 21:27:33 debug defaultlistablebeanfactory:250 - returning cached instance of singleton bean 'com.vaadin.spring.vaadinconfiguration' 2015-09-25 21:27:33 debug commonannotationbeanpostprocessor:216 - found destroy method on class [com.vaadin.spring.internal.defaultviewcache]: void com.vaadin.spring.internal.defaultviewcache.destroy() 2015-09-25 21:27:33 debug commonannotationbeanpostprocessor:288 - registered destroy method on class [com.vaadin.spring.internal.defaultviewcache]: org.springframework.beans.factory.annotation.initdestroyannotationbeanpostprocessor$lifecycleelement@5cd39ffa 2015-09-25 21:27:33 debug defaultlistablebeanfactory:484 - finished creating instance of bean 'viewcache' sep 25, 2015 9:27:33 pm com.vaadin.server.defaulterrorhandler dodefault severe:  org.springframework.beans.factory.beancreationexception: error creating bean name 'vaadinspringapplication': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: com.myapp.vaadin.demo.defaultview com.myapp.vaadin.demo.vaadinspringapplication.defaultview; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'defaultview': scope 'vaadin-view' not active current thread; consider defining scoped proxy bean if intend refer singleton; nested exception java.lang.illegalstateexception: no active view     @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues(autowiredannotationbeanpostprocessor.java:334)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1214)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:543)     @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:482)     @ org.springframework.beans.factory.support.abstractbeanfactory$2.getobject(abstractbeanfactory.java:344)     @ com.vaadin.spring.internal.beanstore.create(beanstore.java:71)     @ com.vaadin.spring.internal.uiscopeimpl$uibeanstore.create(uiscopeimpl.java:279)     @ com.vaadin.spring.internal.beanstore.get(beanstore.java:62)     @ com.vaadin.spring.internal.sessionlockingbeanstore.get(sessionlockingbeanstore.java:46)     @ com.vaadin.spring.internal.uiscopeimpl.get(uiscopeimpl.java:81)     @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:339)     @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:219)     @ org.springframework.beans.factory.support.defaultlistablebeanfactory.getbean(defaultlistablebeanfactory.java:351)     @ org.springframework.beans.factory.support.defaultlistablebeanfactory.getbean(defaultlistablebeanfactory.java:332)     @ org.springframework.context.support.abstractapplicationcontext.getbean(abstractapplicationcontext.java:1057)     @ com.vaadin.spring.server.springuiprovider.createinstance(springuiprovider.java:172)     @ com.vaadin.server.communication.uiinithandler.getbrowserdetailsui(uiinithandler.java:191)     @ com.vaadin.server.communication.uiinithandler.synchronizedhandlerequest(uiinithandler.java:74)     @ com.vaadin.server.synchronizedrequesthandler.handlerequest(synchronizedrequesthandler.java:41)     @ com.vaadin.server.vaadinservice.handlerequest(vaadinservice.java:1408)     @ com.vaadin.server.vaadinservlet.service(vaadinservlet.java:351)     @ javax.servlet.http.httpservlet.service(httpservlet.java:729) 

here application main class:

@theme("valo") @springui public class vaadinspringapplication extends ui {      @configuration     @enablevaadin     public static class vaadinspringapplicationconfiguration {}      @autowired     springviewprovider viewprovider;      @override     protected void init(vaadinrequest request) {         navigator navigator = new navigator(this, this);         navigator.addprovider(viewprovider);         navigator.navigateto(defaultview.name);     } } 

defaultview.java

@springcomponent @springview(name = defaultview.name) public class defaultview extends customcomponent implements view {      public static final string name = "defaultview";      @override     public void enter(viewchangelistener.viewchangeevent event) {         verticallayout layout = new verticallayout();         layout.setmargin(true);         button button = new button("click me");         setcompositionroot(layout);     } } 

as may see logs, spring beans (viewcache, defaultview, springloginview, springmainview) has been created. once i've tried inject main class - got error "scope 'vaadin-view' not active current thread".

please advice. thank you.


Comments