title: null pointer exception when using @Autowired for sessionFactory to get data from database in DHXEventsManager
body: <p>When I use @Autowired annotation for SessionFactory to retrive data from the DB when using DHXEventsManager,java.lang.NullPointerException occurred.I can't fix it.Please anyone help!</p>
  
  <pre><code>package com.dhtmlx.booking.controller;
  import javax.servlet.http.HttpServletRequest;
  import org.hibernate.Session;
  import org.hibernate.SessionFactory;
  import org.springframework.beans.factory.annotation.Autowired;
  import com.dhtmlx.planner.DHXEv;
  import com.dhtmlx.planner.DHXEventsManager;
  import com.dhtmlx.planner.DHXStatus;
  import com.dhtmlx.planner.data.DHXCollection;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  
  public class CustomEventsManager extends DHXEventsManager {
   @Autowired
   SessionFactory sessionfactory;
          public CustomEventsManager(HttpServletRequest request) {
                          super(request);
          }
  
          public Iterable&lt;DHXEv&gt; getEvents() {
  
                          List&lt;DHXEv&gt; evs = new ArrayList&lt;DHXEv&gt;();
                          try {
  
   evs = sessionfactory.getCurrentSession().createCriteria(Event.class).list();
                          } catch (RuntimeException e) {
                                          e.printStackTrace();
                          } 
  
          return evs;
          }
        }
  </code></pre>