title: Spring Boot - java.lang.ClassNotFoundException: org.hibernate.engine.transaction.spi.TransactionContext
body: <p>I am new on Spring Boot. I am trying make a web app using Hibernate but I am experiencing these errors. I looked similar questions but I couldn't find a solution. How can I solve it? </p>
  
  <blockquote>
    <p>2016-12-19 18:56:39.328  INFO 143744 --- [           main]
    org.hibernate.Version                    : HHH000412: Hibernate Core
    {5.0.11.Final} </p>
    
    <p>java.lang.ClassNotFoundException:
    org.hibernate.engine.transaction.spi.TransactionContext   at
    java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    ~[na:1.8.0_91]    at
    java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_91]
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    ~[na:1.8.0_91]    at
    java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_91]
      at
    org.springframework.orm.hibernate4.HibernateTransactionManager.isSameConnectionForEntireSession(HibernateTransactionManager.java:711)
    ~[spring-orm-4.3.4.RELEASE.jar:4.3.4.RELEASE]     at
    org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:445)
    ~[spring-orm-4.3.4.RELEASE.jar:4.3.4.RELEASE]     at
    org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
    ~[spring-tx-4.3.4.RELEASE.jar:4.3.4.RELEASE]  at
    org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:447)
    ~[spring-tx-4.3.4.RELEASE.jar:4.3.4.RELEASE]  at
    org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277)
    ~[spring-tx-4.3.4.RELEASE.jar:4.3.4.RELEASE]  at
    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    ~[spring-tx-4.3.4.RELEASE.jar:4.3.4.RELEASE]  at
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    ~[spring-aop-4.3.4.RELEASE.jar:4.3.4.RELEASE]     at
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
    ~[spring-aop-4.3.4.RELEASE.jar:4.3.4.RELEASE]     at
    com.sun.proxy.$Proxy77.listPosts(Unknown Source) ~[na:na]     at
    com.monat.service.PostServiceImpl.listPosts(PostServiceImpl.java:24)
    ~[classes/:na]    at
    com.monat.controller.PostController.list(PostController.java:20)
    ~[classes/:na]</p>
  </blockquote>
  
  <p>My pom.xml dependencies</p>
  
  <pre><code>&lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.4.2.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
              &lt;version&gt;1.4&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>My Controller class</p>
  
  <pre><code>@Controller
  @RequestMapping("/posts")
  public class PostController 
  {
  
      @Autowired
      PostService postService;
  
      @RequestMapping(value="", method=RequestMethod.GET)
      public String list(Model model){
          model.addAttribute("listData",postService.listPosts());
  
          return "list";
      }
  
  }
  </code></pre>
  
  <p>My Service Class</p>
  
  <pre><code>@Service
  public class PostServiceImpl implements PostService{
  
      @Autowired
      PostDao postDao;
  
      @Override
      public List&lt;Post&gt; listPosts() {
          return postDao.listPosts();
      }
  
  }
  </code></pre>
  
  <p>My Repository Class</p>
  
  <pre><code>@Repository
  public class PostDaoImpl implements PostDao{
  
      @Autowired
      private SessionFactory sessionFactory;
  
      public PostDaoImpl(){}
  
      public PostDaoImpl(SessionFactory sessionFactory){
          this.sessionFactory=sessionFactory;
      }
  
      @Override
      @Transactional
      public List&lt;Post&gt; listPosts() {
  
          @SuppressWarnings("unchecked")
          List&lt;Post&gt; listPost2 = (List&lt;Post&gt;) sessionFactory.getCurrentSession().createQuery("from Post");
  
          return listPost2;
      }
  
  }
  </code></pre>