title: Bean property 'sessionFactory' is not writable or has an invalid setter method.
body: <p>This my utility java file:</p>
  
  <pre><code>public class HibernateUtil {
  
      private static SessionFactory sessionFactory  = null;
  
      public static SessionFactory getSessionFactory() {
          return sessionFactory;
      }
  
      public static void setSessionFactory(SessionFactory sessionFactory) {
          HibernateUtil.sessionFactory = sessionFactory;
      }
  }
  </code></pre>
  
  <p>Spring-servlet.xml:</p>
  
  <pre><code>    &lt;bean id="HibernateUtil" class="com.chrysler.Utilities.HibernateUtil"&gt;
          &lt;property name="sessionFactory" ref="sessionFactory"&gt;&lt;/property&gt;
      &lt;/bean&gt;
      &lt;bean id="sessionFactory"
          class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;
          &lt;property name="configLocation"&gt;
              &lt;value&gt;/WEB-INF/hibernate.cfg.xml&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>When i run this , i am getting below error:</p>
  
  <blockquote>
    <p>org.springframework.beans.NotWritablePropertyException: Invalid
    property 'sessionFactory' of bean class
    [com.chrysler.Utilities.HibernateUtil]: Bean property 'sessionFactory'
    is not writable or has an invalid setter method. Does the parameter
    type of the setter match the return type of the getter?</p>
  </blockquote>