Since its a example class, its not added in the client war file that jetty
runs. Please add a dependency in client/pom.xml as below

 <dependency>
   <groupId>org.apache.cloudstack</groupId>
   <artifactId>cloud-plugin-example-dns-notifier</artifactId>
   <version>${project.version}</version>
 </dependency>



On 19/04/13 5:58 AM, "Soheil Eizadi" <seiz...@infoblox.com> wrote:

>I am trying to run the DnsNotifier example in my CloudStack Environment,
>I am having trouble with the Spring wiring. I modified the
>DnsNotifier.java file to add @Component annotation and modified the two
>files componentContext.xml.in and nonossComponentContext.xml.in to add
>reference to the DnsNotifier. I get everything to build but the Spring
>Class Loader can not find DnsNotifier Class to load, what more needs to
>be done to get this to run?
>-Soheil
>
>ovider,databaseUpgradeChecker,configurationDaoImpl,GlobalLoadBalancingRule
>sServiceImpl,DnsNotifier,niciraNvpDaoImpl,niciraNvpNicMappingDaoImpl,nicir
>aNvpRouterMappingDaoImpl,NiciraNvpGuestNetworkGuru,NiciraNvp,MidoNetGuestN
>etworkGuru,MidoNetElement,userAuthenticators,userPasswordEncoders,security
>Checkers,resourceDiscoverers,haInvestigators,haFenceBuilders,deploymentPla
>nners,podAllocators,hostAllocators,storagePoolAllocators,ipDeployers,dhcpP
>roviders,networkGurus,networkElements,org.springframework.context.annotati
>on.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root
>of factory hierarchy
>ERROR [web.context.ContextLoader] (main:) Context initialization failed
>org.springframework.beans.factory.BeanCreationException: Error creating
>bean with name 'actionEventUtils': Injection of autowired dependencies
>failed; nested exception is
>org.springframework.beans.factory.BeanCreationException: Could not
>autowire field: com.cloud.event.dao.EventDao
>com.cloud.event.ActionEventUtils.eventDao; nested exception is
>org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
>find class [org.apache.cloudstack.network.element.DnsNotifier] for bean
>with name 'DnsNotifier' defined in class path resource
>[componentContext.xml]; nested exception is
>java.lang.ClassNotFoundException:
>org.apache.cloudstack.network.element.DnsNotifier
>
>Administrators-MacBook-Pro-7:cloudstack seizadi$ find . -name
>DnsNotifier.class
>./plugins/network-elements/dns-notifier/target/classes/org/apache/cloudsta
>ck/network/element/DnsNotifier.class
>
>diff --git 
>a/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/
>element/DnsNotifier.java
>b/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/
>element/DnsNotifier.java
>index c421344..8f8986d 100644
>--- 
>a/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/
>element/DnsNotifier.java
>+++ 
>b/plugins/network-elements/dns-notifier/src/org/apache/cloudstack/network/
>element/DnsNotifier.java
>@@ -22,7 +22,9 @@ import java.util.Map;
> import java.util.Set;
>
> import javax.ejb.Local;
>-import javax.naming.ConfigurationException;
>+
>+import org.apache.log4j.Logger;
>+import org.springframework.stereotype.Component;
>
> import com.cloud.deploy.DeployDestination;
> import com.cloud.exception.ConcurrentOperationException;
>@@ -45,13 +47,17 @@ import com.cloud.vm.VirtualMachineProfile;
>  * @author ahuang
>  *
>  */
>+
>+@Component
> @Local(NetworkElement.class)
> public class DnsNotifier extends AdapterBase implements NetworkElement {
>
>
>diff --git a/client/tomcatconf/componentContext.xml.in
>b/client/tomcatconf/componentContext.xml.in
>index bea2f78..202a998 100644
>--- a/client/tomcatconf/componentContext.xml.in
>+++ b/client/tomcatconf/componentContext.xml.in
>@@ -46,6 +46,14 @@
>   <bean id="configurationDaoImpl"
>class="com.cloud.configuration.dao.ConfigurationDaoImpl" />
>
>   <bean id="GlobalLoadBalancingRulesServiceImpl" class
>="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl"
>/>
>+
>+  <bean id="DnsNotifier"
>class="org.apache.cloudstack.network.element.DnsNotifier">
>+    <property name="name" value="DnsNotifier"/>
>+  </bean>
>+
>
>   <!--
>     Nicira support components
>@@ -240,6 +248,8 @@
>           <ref bean="VpcVirtualRouter"/>
>           <ref bean="NiciraNvp" />
>           <ref bean="MidoNetElement"/>
>+          <ref bean="DnsNotifier"/>
> <!--
>           <ref bean="BareMetalDhcp"/>
>           <ref bean="BareMetalPxe"/>
>
>diff --git a/client/tomcatconf/nonossComponentContext.xml.in
>b/client/tomcatconf/nonossComponentContext.xml.in
>index fc8a9cd..9da3d06 100644
>--- a/client/tomcatconf/nonossComponentContext.xml.in
>+++ b/client/tomcatconf/nonossComponentContext.xml.in
>@@ -79,6 +79,13 @@
>   <bean id="vmwareContextFactory"
>class="com.cloud.hypervisor.vmware.resource.VmwareContextFactory" />
>
>+  <bean id="DnsNotifier"
>class="org.apache.cloudstack.network.element.DnsNotifier">
>+    <property name="name" value="DnsNotifier"/>
>+  </bean>
>+
>+  <!--
>     Nicira support components
>   -->
>   <bean id="niciraNvpDaoImpl"
>class="com.cloud.network.dao.NiciraNvpDaoImpl" />
>@@ -331,6 +338,8 @@
>           <ref bean="Ovs"/>
>           <ref bean="SecurityGroupProvider"/>
>           <ref bean="VpcVirtualRouter"/>
>+          <ref bean="DnsNotifier"/>
> <!--
>           <ref bean="BareMetalDhcp"/>
>           <ref bean="BareMetalPxe"/>
>


Reply via email to