Injecting service beans doesnt work for Wicket pages mounted by AnnotatedMountScanner?
<p>I have a simple Wicket 7.4.0 project when Wicket is configured inside of SpringBoot. I have @Service spring beans that want to inject into Wicket pages. Now when Wicket page is mounted by mountPage(..) command @Inject annotation works fine for wicket page. But @Inject doesnt work for wicket pages mounted by AnnotatedMountScanner() . Any idea whats wrong here? See my code snippet below.</p>

<pre><code>@Override
  public void init() {
    super.init();

    getComponentInstantiationListeners().add(
        new SpringComponentInjector(this, applicationContext));

    new AnnotatedMountScanner().scanPackage("com").mount(this);
    mountPage("/x", PageAbout.class);

    getMarkupSettings().setDefaultMarkupEncoding("utf-8");

  }
</code></pre>

<p><strong>EDIT #1 - Full traceback I'm getting</strong></p>

<pre><code>Unexpected RuntimeException

Last cause: Concrete bean could not be received from the application context for class: com.dubture.TestService.
WicketMessage: Can't instantiate page using constructor 'public com.dubture.PageAbout(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. An exception has been thrown during construction!

Stacktrace

Root cause:

java.lang.IllegalStateException: Concrete bean could not be received from the application context for class: com.dubture.TestService.
     at org.apache.wicket.spring.SpringBeanLocator.lookupSpringBean(SpringBeanLocator.java:275)
     at org.apache.wicket.spring.SpringBeanLocator.locateProxyTarget(SpringBeanLocator.java:198)
     at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:150)
     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.&lt;init&gt;(Component.java:687)
     at org.apache.wicket.MarkupContainer.&lt;init&gt;(MarkupContainer.java:180)
     at org.apache.wicket.Page.&lt;init&gt;(Page.java:170)
     at org.apache.wicket.Page.&lt;init&gt;(Page.java:159)
     at org.apache.wicket.markup.html.WebPage.&lt;init&gt;(WebPage.java:105)
     at com.dubture.PageAbout.&lt;init&gt;(PageAbout.java:33)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:171)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76)
     at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:102)
     at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:271)
     at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:169)
     at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
     at org.apache.wicket.request.handler.render.WebPageRenderer.isPageStateless(WebPageRenderer.java:287)
     at org.apache.wicket.request.handler.render.WebPageRenderer.shouldRenderPageAndWriteResponse(WebPageRenderer.java:329)
     at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:193)
     at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
     at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895)
     at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
     at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
     at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
     at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
     at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261)
     at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203)
     at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
     at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)
     at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
     at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410)
     at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
     at java.lang.Thread.run(Thread.java:745)

Complete stack:

org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public com.dubture.PageAbout(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. An exception has been thrown during construction!
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:194)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76)
     at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:102)
     at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:271)
     at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:169)
     at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
     at org.apache.wicket.request.handler.render.WebPageRenderer.isPageStateless(WebPageRenderer.java:287)
     at org.apache.wicket.request.handler.render.WebPageRenderer.shouldRenderPageAndWriteResponse(WebPageRenderer.java:329)
     at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:193)
     at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
     at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895)
     at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
     at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
     at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
     at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
     at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261)

java.lang.reflect.InvocationTargetException
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:171)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76)
     at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:102)
     at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:271)
     at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:169)
     at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
     at org.apache.wicket.request.handler.render.WebPageRenderer.isPageStateless(WebPageRenderer.java:287)
     at org.apache.wicket.request.handler.render.WebPageRenderer.shouldRenderPageAndWriteResponse(WebPageRenderer.java:329)
     at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:193)
     at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
     at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895)
     at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
     at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
     at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
     at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
     at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261)
</code></pre>