We should move all the simulator related classes into 
client/tomcatconf/simulatorComponentContext.xml.in
Let me fix it, thanks for your report.

> -----Original Message-----
> From: Vijayendra Bhamidipati
> Sent: Tuesday, July 09, 2013 2:02 PM
> To: dev@cloudstack.apache.org
> Cc: Edison Su
> Subject: SimulatorSecondaryDiscoverer bean
> 
> Hi Edison,
> 
> It looks like this bean is missing from the applicationContext.xml file with
> commit# 5e13327339305cd81993952abbd8c19409a48537, causing the mgmt.
> server to fail to startup with this error :
> 
> INFO  [hypervisor.vmware.VmwareServerDiscoverer] (main:)
> VmwareServerDiscoverer is constructed INFO  [web.context.ContextLoader]
> (main:) Root WebApplicationContext: initialization completed in 20594 ms
> INFO  [cloud.utils.LogUtils] (main:) log4j configuration found at
> /root/mywork/cloudstack/asf/latest/cloudstack/client/target/cloud-client-
> ui-4.2.0-SNAPSHOT/WEB-INF/classes/log4j-cloud.xml
> INFO  [factory.annotation.AutowiredAnnotationBeanPostProcessor] (main:)
> JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
> 2013-07-09 07:19:11.975:INFO::Started
> SelectChannelConnector@0.0.0.0:8080
> [INFO] Started Jetty Server
> Exception in thread "Timer-2"
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'mockAgentManagerImpl': Injection of autowired
> dependencies failed; nested exception is
> org.springframework.beans.factory.BeanCreationException: Could not
> autowire field: com.cloud.resource.SimulatorSecondaryDiscoverer
> com.cloud.agent.manager.MockAgentManagerImpl.discoverer; nested
> exception is
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No
> matching bean of type [com.cloud.resource.SimulatorSecondaryDiscoverer]
> found for dependency: expected at least 1 bean which qualifies as autowire
> candidate for this dependency. Dependency annotations:
> {@javax.inject.Inject()}
>         at
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
> ostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostPro
> cessor.java:287)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.configureBean(AbstractAutowireCapableBeanFactory.java:314)
>         at
> com.cloud.utils.component.ComponentContext.initComponentsLifeCycle(Co
> mponentContext.java:71)
>         at
> com.cloud.servlet.CloudStartupServlet$1.run(CloudStartupServlet.java:50)
>         at java.util.TimerThread.mainLoop(Timer.java:534)
>         at java.util.TimerThread.run(Timer.java:484)
> Caused by: org.springframework.beans.factory.BeanCreationException:
> Could not autowire field: com.cloud.resource.SimulatorSecondaryDiscoverer
> com.cloud.agent.manager.MockAgentManagerImpl.discoverer; nested
> exception is
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No
> matching bean of type [com.cloud.resource.SimulatorSecondaryDiscoverer]
> found for dependency: expected at least 1 bean which qualifies as autowire
> candidate for this dependency. Dependency annotations:
> {@javax.inject.Inject()}
>         at
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
> ostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPost
> Processor.java:506)
>         at
> org.springframework.beans.factory.annotation.InjectionMetadata.inject(Inj
> ectionMetadata.java:87)
>         at
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
> ostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostPro
> cessor.java:284)
>         ... 6 more
> Caused by:
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No
> matching bean of type [com.cloud.resource.SimulatorSecondaryDiscoverer]
> found for dependency: expected at least 1 bean which qualifies as autowire
> candidate for this dependency. Dependency annotations:
> {@javax.inject.Inject()}
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.rais
> eNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:952)
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.doR
> esolveDependency(DefaultListableBeanFactory.java:821)
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.res
> olveDependency(DefaultListableBeanFactory.java:735)
>         at
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
> ostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPost
> Processor.java:478)
>         ... 8 more
> INFO  [factory.annotation.AutowiredAnnotationBeanPostProcessor]
> (928969643@qtp-386907765-0:) JSR-330 'javax.inject.Inject' annotation found
> and supported for autowiring
> 
> 
> 
> Adding the following line to the file fixed the issue:
> 
> 
> [root@vijay-vm1 cloudstack]# git diff -w diff --git
> a/client/tomcatconf/applicationContext.xml.in
> b/client/tomcatconf/applicationContext.xml.in
> index 14255c1..3426d0b 100644
> --- a/client/tomcatconf/applicationContext.xml.in
> +++ b/client/tomcatconf/applicationContext.xml.in
> @@ -859,6 +859,7 @@
>    <bean id="lBHealthCheckManagerImpl"
> class="com.cloud.network.lb.LBHealthCheckManagerImpl" />
>    <bean id="mockAgentManagerImpl"
> class="com.cloud.agent.manager.MockAgentManagerImpl" />
> 
> +
>    <bean id="volumeManagerImpl"
> class="com.cloud.storage.VolumeManagerImpl" />
>    <bean id="ApplicationLoadBalancerService"
> class="org.apache.cloudstack.network.lb.ApplicationLoadBalancerManagerI
> mpl" />
>    <bean id="InternalLoadBalancerVMManager"
> class="org.apache.cloudstack.network.lb.InternalLoadBalancerVMManagerI
> mpl" /> @@ -869,6 +870,7 @@
>    <bean id="mockVmManagerImpl"
> class="com.cloud.agent.manager.MockVmManagerImpl" />
>    <bean id="mockNetworkManagerImpl"
> class="com.cloud.agent.manager.MockNetworkManagerImpl" />
>    <bean id="simulatorManagerImpl"
> class="com.cloud.agent.manager.SimulatorManagerImpl" />
> +  <bean id="simulatorSecondaryDiscoverer"
> + class="com.cloud.resource.SimulatorSecondaryDiscoverer" />
>    <bean id="vMSnapshotManagerImpl"
> class="com.cloud.vm.snapshot.VMSnapshotManagerImpl" />
> 
> 
> [root@vijay-vm1 cloudstack]#
> 
> Can you please check in the above change to the master? Thanks!
> 
> 
> Regards,
> Vijay
> 
> 
> 

Reply via email to