title: Autowiring does not work
body: <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
  &lt;!-- Turn on AspectJ @Configurable support --&gt;
  
  &lt;context:spring-configured /&gt;
  &lt;context:annotation-config /&gt; 
  &lt;context:property-placeholder location="classpath*:*.properties" /&gt;
  &lt;context:component-scan base-package="your.intermedix" /&gt;
  
  
  &lt;!-- Turn on @Autowired, @PostConstruct etc support --&gt;
  &lt;bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" /&gt;
  &lt;bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor" /&gt;
  
  &lt;bean id="icontact" class="your.intermedix.services.IContact"/&gt;
  &lt;bean id="MyVaadinApplication" class="your.intermedix.MyVaadinApplication"/&gt;
  &lt;bean id="ContactSerImpl" class="your.intermedix.services.ContactSerImpl"/&gt;
  
      &lt;bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="myDataSource" /&gt;
          &lt;property name="annotatedClasses"&gt;
              &lt;list&gt;
                  &lt;value&gt;your.intermedix.domain.Contact&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;create&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
          &lt;property name="url" value="jdbc:mysql://127.0.0.1:3306/spring"/&gt;
          &lt;property name="username" value="monty"/&gt;
          &lt;property name="password" value="indian"/&gt;
      &lt;/bean&gt;   
  &lt;/beans&gt;
  </code></pre>
  
  <p>Now when i try to call the interface method, it does not... i dont know. I followed this post completely and i am not sure why its not happening. </p>
  
  <p><a href="https://stackoverflow.com/questions/3153546/how-does-autowiring-work-in-spring">How does autowiring work in Spring?</a></p>
  
  <p>I did place my <code>@Controller</code> and <code>@Service</code> tags to respective classes and used @Autowire annotation like this. </p>
  
  <pre><code>@Autowired
  private transient IContact icontact;
  </code></pre>
  
  <p>Now when i try to call my <code>icontact.methodname()</code> it does not work. </p>
  
  <p>My Interface</p>
  
  <pre><code>package your.intermedix.services;
  
  import your.intermedix.domain.Contact;
  
  public interface IContact {
      public void saveContact(Contact contact);
      public void hello();
  
  }
  </code></pre>
  
  <p>This is Service class </p>
  
  <pre><code>package your.intermedix.services;
  
  import org.hibernate.SessionFactory;
  
  import org.springframework.orm.hibernate3.HibernateTemplate;
  import org.springframework.stereotype.Service;
  
  import your.intermedix.domain.Contact;
  import your.intermedix.services.IContact;
  
  @Service
  public class ContactSerImpl implements IContact {
  
      private HibernateTemplate hibernateTemplate;
  
          public void setSessionFactory(SessionFactory sessionFactory) {
              this.hibernateTemplate = new HibernateTemplate(sessionFactory);
      }
  
          public void saveContact(Contact contact) {
              System.out.println("Hello Guru");
              //System.out.println(contact);
              //hibernateTemplate.saveOrUpdate(contact);
          }
  
          public void hello() {
              System.out.println("Hello Guru");
          }
  }
  </code></pre>
  
  <p>Now my Actual implementation class. </p>
  
  <pre><code>@SuppressWarnings("serial")
  @Configurable(preConstruction = true)
  @Controller
  public class MyVaadinApplication extends Application implements Button.ClickListener
  {
      @Autowired
  private transient IContact icontact;
  
  ..........................
  ...................
  
  public void buttonClick(ClickEvent event) {
  
              if (event.getSource() == save) {
                  try {
                      form.commit();
                      icontact.hello();
                      icontact.saveContact(contact);
                  }
                   catch (Exception e)    {
  
                   }
                  }
              }
          }
  </code></pre>