Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5662

@SpringBean(name="something", required=false) still throws org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'something' is defined

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.16.0
    • 7.0.0-M3, 6.17.0
    • wicket-spring
    • None

    Description

      Example:

      public class TwitterLoginLink extends StatelessLink<Void> {
      			
      	@SpringBean(name="twitterMgr", required=false)
      	private TwitterManager twitterMgr;
      

      still throws:

      org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'twitterMgr' is defined
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:641)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1159)
      at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:418)
      at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:1002)
      at org.apache.wicket.spring.SpringBeanLocator.isSingletonBean(SpringBeanLocator.java)
      at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:141)
      at org.apache.wicket.injection.Injector.inject(Injector.java:111)
      at org.apache.wicket.spring.injection.annot.SpringComponentInjector.inject(SpringComponentInjector.java:124)
      at org.apache.wicket.spring.injection.annot.SpringComponentInjector.onInstantiation(SpringComponentInjector.java:130)
      at org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)
      at org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)
      at org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
      at org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
      at org.apache.wicket.Component.<init>(Component.java:686)
      at org.apache.wicket.MarkupContainer.<init>(MarkupContainer.java:121)
      at org.apache.wicket.markup.html.WebMarkupContainer.<init>(WebMarkupContainer.java:52)
      at org.apache.wicket.markup.html.link.AbstractLink.<init>(AbstractLink.java:57)
      at org.apache.wicket.markup.html.link.AbstractLink.<init>(AbstractLink.java:44)
      at org.apache.wicket.markup.html.link.Link.<init>(Link.java:105)
      at org.apache.wicket.markup.html.link.StatelessLink.<init>(StatelessLink.java:42)
      at org.soluvas.web.login.twitter.TwitterLoginLink.<init>(TwitterLoginLink.java:40)
      at org.soluvas.web.login.DedicatedLoginPanel$FormSignIn.<init>(DedicatedLoginPanel.java:90)
      at org.soluvas.web.login.DedicatedLoginPanel.onInitialize(DedicatedLoginPanel.java:58)
      at org.apache.wicket.Component.fireInitialize(Component.java:876)
      at org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:967)
      at org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:963)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)
      at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:875)
      at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:962)
      at org.apache.wicket.Page.isPageStateless(Page.java:463)
      at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.getPageInfo(AbstractBookmarkableMapper.java:447)
      at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.mapHandler(AbstractBookmarkableMapper.java:391)
      at org.apache.wicket.core.request.mapper.MountedMapper.mapHandler(MountedMapper.java:395)
      at org.apache.wicket.request.mapper.CompoundRequestMapper.mapHandler(CompoundRequestMapper.java:215)
      at org.apache.wicket.request.cycle.RequestCycle.mapUrlFor(RequestCycle.java:429)
      at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:273)
      at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
      at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
      at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
      at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
      at org.soluvas.web.site.SecuredWicketAtmosphereHandler$CustomFilterChain.doFilter(SecuredWicketAtmosphereHandler.java:199)
      at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
      at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
      at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
      at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
      at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
      at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
      at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
      at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
      at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
      at org.soluvas.web.site.SecuredWicketAtmosphereHandler$CustomFilterChain.doFilter(SecuredWicketAtmosphereHandler.java:199)
      at org.soluvas.web.site.SecuredWicketAtmosphereHandler$CustomFilterChain.invokeFilterChain(SecuredWicketAtmosphereHandler.java:185)
      at org.soluvas.web.site.SecuredWicketAtmosphereHandler.onRequest(SecuredWicketAtmosphereHandler.java:91)
      at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:187)
      at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:98)
      at org.atmosphere.container.Tomcat7CometSupport.service(Tomcat7CometSupport.java:96)
      at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1809)
      at org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:255)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterEvent(ApplicationFilterChain.java:484)
      at org.apache.catalina.core.ApplicationFilterChain.doFilterEvent(ApplicationFilterChain.java:377)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:123)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      at org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:171)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:1810)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      

      Workaround:

          @Autowire(required=false)
          private TwitterManager twitterMgr;
      

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            ceefour Hendy Irawan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: