title: hibernate error: org.jboss.resteasy.spi.UnhandledException: java.lang.NoSuchMethodError: org.hibernate.Session.close()Ljava/sql/Connection;
body: <p>Am deploying a webservice with hibernate on wildfly 10.</p>
  
  <p>My pom.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;org.declercq.reportbuilderback&lt;/groupId&gt;
      &lt;artifactId&gt;reportbuilderback&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;licenses&gt;
          &lt;license&gt;
              &lt;name&gt;Apache License, Version 2.0&lt;/name&gt;
              &lt;distribution&gt;repo&lt;/distribution&gt;
              &lt;url&gt;http://www.apache.org/licenses/LICENSE-2.0.html&lt;/url&gt;
          &lt;/license&gt;
      &lt;/licenses&gt;
  
      &lt;properties&gt;
          &lt;!-- Explicitly declaring the source encoding eliminates the following 
              message: --&gt;
          &lt;!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered 
              resources, i.e. build is platform dependent! --&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  
          &lt;!-- JBoss dependency versions --&gt;
          &lt;version.wildfly.maven.plugin&gt;1.0.2.Final&lt;/version.wildfly.maven.plugin&gt;
  
          &lt;!-- Define the version of the JBoss BOMs we want to import to specify 
              tested stacks. --&gt;
          &lt;version.jboss.bom&gt;8.2.1.Final&lt;/version.jboss.bom&gt;
  
          &lt;!-- other plugin versions --&gt;
          &lt;version.compiler.plugin&gt;3.1&lt;/version.compiler.plugin&gt;
          &lt;version.surefire.plugin&gt;2.16&lt;/version.surefire.plugin&gt;
          &lt;version.war.plugin&gt;2.5&lt;/version.war.plugin&gt;
  
          &lt;!-- maven-compiler-plugin --&gt;
          &lt;maven.compiler.target&gt;1.7&lt;/maven.compiler.target&gt;
          &lt;maven.compiler.source&gt;1.7&lt;/maven.compiler.source&gt;
      &lt;/properties&gt;
  
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;!-- JBoss distributes a complete set of Java EE 7 APIs including a Bill
                  of Materials (BOM). A BOM specifies the versions of a "stack" (or a collection) 
                  of artifacts. We use this here so that we always get the correct versions 
                  of artifacts. Here we use the jboss-javaee-7.0-with-tools stack (you can
                  read this as the JBoss stack of the Java EE 7 APIs, with some extras tools
                  for your project, such as Arquillian for testing) and the jboss-javaee-7.0-with-hibernate
                  stack you can read this as the JBoss stack of the Java EE 7 APIs, with extras
                  from the Hibernate family of projects) --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.wildfly.bom&lt;/groupId&gt;
                  &lt;artifactId&gt;jboss-javaee-7.0-with-tools&lt;/artifactId&gt;
                  &lt;version&gt;${version.jboss.bom}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.wildfly.bom&lt;/groupId&gt;
                  &lt;artifactId&gt;jboss-javaee-7.0-with-hibernate&lt;/artifactId&gt;
                  &lt;version&gt;${version.jboss.bom}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.wildfly.bom&lt;/groupId&gt;
                  &lt;artifactId&gt;jboss-javaee-7.0-with-resteasy&lt;/artifactId&gt;
                  &lt;version&gt;${version.jboss.bom}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&gt;
  
          &lt;!-- First declare the APIs we depend on and need for compilation. All 
              of them are provided by JBoss WildFly --&gt;
  
          &lt;!-- Import the CDI API, we use provided scope as the API is included in 
              JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.enterprise&lt;/groupId&gt;
              &lt;artifactId&gt;cdi-api&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the Common Annotations API (JSR-250), we use provided scope 
              as the API is included in JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.spec.javax.annotation&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-annotations-api_1.2_spec&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the JAX-RS API, we use provided scope as the API is included 
              in JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;jaxrs-api&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the JPA API, we use provided scope as the API is included in 
              JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.1-api&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the EJB API, we use provided scope as the API is included in 
              JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.spec.javax.ejb&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-ejb-api_3.2_spec&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- JSR-303 (Bean Validation) Implementation --&gt;
          &lt;!-- Provides portable constraints such as @Email --&gt;
          &lt;!-- Hibernate Validator is shipped in JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                      &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Import the JSF API, we use provided scope as the API is included in 
              JBoss WildFly --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.spec.javax.faces&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-jsf-api_2.2_spec&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Now we declare any tools needed --&gt;
  
          &lt;!-- Annotation processor to generate the JPA 2.0 metamodel classes for 
              typesafe criteria queries --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpamodelgen&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Annotation processor that raising compilation errors whenever constraint 
              annotations are incorrectly used. --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator-annotation-processor&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Needed for running tests (you may also use TestNG) --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-client&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-multipart-provider&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.spec.javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-servlet-api_3.1_spec&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-jaxb-provider&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;async-http-servlet-3.0&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;!-- Maven will append the version to the finalName (which is the name 
              given to the generated war, and hence the context root) --&gt;
          &lt;finalName&gt;${project.artifactId}&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${version.war.plugin}&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;!-- Java EE 7 doesn't require web.xml, Maven needs to catch up! --&gt;
                      &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;!-- The WildFly plugin deploys your war to a local WildFly container --&gt;
              &lt;!-- To use, run: mvn package wildfly:deploy --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.wildfly.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;wildfly-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${version.wildfly.maven.plugin}&lt;/version&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;!-- The default profile skips all tests, though you can tune it to run 
                  just unit tests based on a custom pattern --&gt;
              &lt;!-- Seperate profiles are provided for running all tests, including Arquillian 
                  tests that execute in the specified container --&gt;
              &lt;id&gt;default&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;build&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                          &lt;version&gt;${version.surefire.plugin}&lt;/version&gt;
                          &lt;configuration&gt;
                              &lt;skip&gt;true&lt;/skip&gt;
                          &lt;/configuration&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
  
  
  
  
  
  
  
      &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>My UserDao:</p>
  
  <pre><code>@SuppressWarnings("unchecked")
      public List&lt;User&gt; getAllUsers(){
          System.out.println("0");
          Session session=HibernateUtil.getSessionFactory().openSession();
          System.out.println("0,5");
          Transaction tx = null;
          List&lt;User&gt; allUsers=null;
          try{
              tx = session.beginTransaction();
              System.out.println("1");
  
              /**CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();
              CriteriaQuery&lt;User&gt; criteria = criteriaBuilder.createQuery(User.class);
              criteria.from(User.class);
  
              allUsers = session.createQuery(criteria).getResultList();
              */
              Criteria criteria = session.createCriteria(User.class);
              allUsers = (List&lt;User&gt;)criteria.list();
              System.out.println("2");
  
              tx.commit();
              System.out.println("3");
              return allUsers;
          }
          catch(HibernateException e){
              if(tx != null){
                  tx.rollback();
                  System.out.println("4");
              }
              return allUsers;
          }
          finally{
              session.close();
              System.out.println("5");
  
          }
      }
  </code></pre>
  
  <p>My webservice calling this DAO:</p>
  
  <pre><code>@GET
      @Path("/all")
      public List&lt;User&gt; listAll() {
          System.out.println("Here");
          final List&lt;User&gt; users = new UserDao().getAllUsers();
          System.out.println("Here 2");
          return users;
      }
  </code></pre>
  
  <p>My server output:</p>
  
  <pre><code>10:16:53,980 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 59) RESTEASY002225: Deploying javax.ws.rs.core.Application: class org.declercq.reportbuilderback.webservices.RestApplication$Proxy$_$$_WeldClientProxy
  10:16:54,097 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 59) WFLYUT0021: Registered web context: /reportbuilderback
  10:16:54,158 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "reportbuilderback.war" (runtime-name : "reportbuilderback.war")
  10:16:54,393 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
  10:16:54,394 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
  10:16:54,397 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 14662ms - Started 422 of 670 services (404 services are lazy, passive or on-demand)
  10:17:02,761 INFO  [stdout] (default task-3) Here
  10:17:02,762 INFO  [stdout] (default task-3) 0
  10:17:03,138 WARN  [org.hibernate.orm.connections] (default task-3) HHH10001002: Using Hibernate built-in connection pool (not for production use!)
  10:17:03,140 INFO  [org.hibernate.orm.connections] (default task-3) HHH10001005: using driver [org.postgresql.Driver] at URL [jdbc:postgresql://127.0.0.1:5432/reportbuilderwebservices]
  10:17:03,140 INFO  [org.hibernate.orm.connections] (default task-3) HHH10001001: Connection properties: {user=reportbuilderwebservices, password=****}
  10:17:03,141 INFO  [org.hibernate.orm.connections] (default task-3) HHH10001003: Autocommit mode: false
  10:17:03,141 INFO  [org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (default task-3) HHH000115: Hibernate connection pool size: 10 (min=1)
  10:17:03,162 INFO  [org.hibernate.dialect.Dialect] (default task-3) HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
  10:17:03,340 INFO  [org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl] (default task-3) HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
  10:17:03,349 INFO  [org.hibernate.type.BasicTypeRegistry] (default task-3) HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@2f2d8520
  10:17:03,352 INFO  [org.hibernate.envers.boot.internal.EnversServiceImpl] (default task-3) Envers integration enabled? : true
  10:17:03,363 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (default task-3) HHH000228: Running hbm2ddl schema update
  10:17:03,452 INFO  [stdout] (default task-3) 0,5
  10:17:03,452 INFO  [stdout] (default task-3) 1
  10:17:03,459 INFO  [stdout] (default task-3) 2
  10:17:03,460 INFO  [stdout] (default task-3) 3
  10:17:03,462 ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to /reportbuilderback/rest/users/all: org.jboss.resteasy.spi.UnhandledException: java.lang.NoSuchMethodError: org.hibernate.Session.close()Ljava/sql/Connection;
      at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:77)
      at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:220)
      at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:175)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:209)
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
      at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
      at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
      at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
      at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
      at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
      at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
      at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
      at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
      at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
      at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
      at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
      at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
      at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
      at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
      at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
      at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
      at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
      at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
      at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.NoSuchMethodError: org.hibernate.Session.close()Ljava/sql/Connection;
      at org.declercq.reportbuilderback.dao.UserDao.getAllUsers(UserDao.java:76)
      at org.declercq.reportbuilderback.webservices.UserWebService.listAll(UserWebService.java:52)
      at org.declercq.reportbuilderback.webservices.UserWebService$Proxy$_$$_WeldClientProxy.listAll(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
      at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
      at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
      at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:402)
      ... 43 more
  </code></pre>
  
  <p>Claiming that:</p>
  
  <pre><code>Caused by: java.lang.NoSuchMethodError: org.hibernate.Session.close()Ljava/sql/Connection;
      at org.declercq.reportbuilderback.dao.UserDao.getAllUsers(UserDao.java:76)
  </code></pre>
  
  <p>I'm not using Spring by the way for this.
  Could someone give me some insight here?
  I'm guessing it must be some conflict with 2 hibernate libraries of different versions or something like that, but I'm not really sure where it is...</p>
  
  <p>UPDATE: I'm still not getting this to work.
  Below my output from maven dependency tree:</p>
  
  <pre><code>mvn dependency:tree 
  [INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building librarysoftbackend 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ librarysoftbackend ---
  [INFO] org.declercq.librarysoftbackend:librarysoftbackend:war:0.0.1-SNAPSHOT
  [INFO] +- javax.enterprise:cdi-api:jar:1.2:provided
  [INFO] |  +- javax.el:javax.el-api:jar:3.0.0:provided
  [INFO] |  +- javax.interceptor:javax.interceptor-api:jar:1.2:provided
  [INFO] |  \- javax.inject:javax.inject:jar:1:provided
  [INFO] +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:jar:1.0.0.Final:provided
  [INFO] +- org.jboss.resteasy:jaxrs-api:jar:3.0.10.Final:provided
  [INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:provided
  [INFO] +- org.jboss.spec.javax.ejb:jboss-ejb-api_3.2_spec:jar:1.0.0.Final:provided
  [INFO] +- org.hibernate:hibernate-validator:jar:5.1.3.Final:provided
  [INFO] |  +- javax.validation:validation-api:jar:1.1.0.Final:provided
  [INFO] |  +- org.jboss.logging:jboss-logging:jar:3.1.4.GA:provided
  [INFO] |  \- com.fasterxml:classmate:jar:1.0.0:provided
  [INFO] +- org.hibernate:hibernate-jpamodelgen:jar:4.3.5.Final:provided
  [INFO] |  \- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:provided
  [INFO] +- org.hibernate:hibernate-validator-annotation-processor:jar:5.1.3.Final:provided
  [INFO] +- junit:junit:jar:4.3:test
  [INFO] +- org.hibernate:hibernate-core:jar:4.3.7.Final:provided
  [INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:provided
  [INFO] |  +- dom4j:dom4j:jar:1.6.1:provided
  [INFO] |  +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:provided
  [INFO] |  +- org.javassist:javassist:jar:3.18.1-GA:provided
  [INFO] |  +- antlr:antlr:jar:2.7.7:provided
  [INFO] |  \- org.jboss:jandex:jar:1.1.0.Final:provided
  [INFO] +- org.jboss.resteasy:async-http-servlet-3.0:jar:3.0.10.Final:provided
  [INFO] +- org.jboss.resteasy:resteasy-client:jar:3.0.10.Final:provided
  [INFO] \- org.jboss.resteasy:resteasy-jaxrs:jar:3.0.10.Final:provided
  [INFO]    +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar:1.0.1.Final:provided
  [INFO]    +- javax.activation:activation:jar:1.1.1:provided
  [INFO]    +- org.apache.httpcomponents:httpclient:jar:4.2.6:provided
  [INFO]    |  +- org.apache.httpcomponents:httpcore:jar:4.2.5:provided
  [INFO]    |  +- commons-logging:commons-logging:jar:1.1.1:provided
  [INFO]    |  \- commons-codec:commons-codec:jar:1.6:provided
  [INFO]    +- commons-io:commons-io:jar:2.1:provided
  [INFO]    \- net.jcip:jcip-annotations:jar:1.0:provided
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 2.965 s
  [INFO] Finished at: 2016-11-11T13:40:28+01:00
  [INFO] Final Memory: 15M/174M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>Anyone any idea?</p>