title: Hibernate java.lang.NoSuchMethodError: > org.hibernate.integrator.internal.IntegratorServiceImpl.<init>
body: <p>Using hibernate on my jax-rs I'm getting this error:</p>
  
  <blockquote>
    <p>HTTP ERROR 500</p>
    
    <p>Problem accessing /services/datesTest. Reason:</p>
  
  <pre><code>Server Error Caused by:
  </code></pre>
    
    <p>java.lang.ExceptionInInitializerError     at
    connectors.Connector.buildSessionFactory(Connector.java:32)   at
    connectors.Connector.getSessionFactory(Connector.java:37)     at
    connectors.Connector.getSession(Connector.java:45)    at
    mainproject.services.HibernateDatesTest.verifyToken(HibernateDatesTest.java:24)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)     at
    com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
      at
    com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
      at
    com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
      at
    com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
      at
    com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
      at
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      at
    com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
      at
    com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)     at
    org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
      at
    org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
      at
    org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
      at
    org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
      at
    org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
      at
    org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
      at
    org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
      at
    org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
      at
    org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
      at
    org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
      at
    org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
      at org.eclipse.jetty.server.Server.handle(Server.java:349)  at
    org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
      at
    org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
      at
    org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
      at
    org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
      at
    org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
      at
    org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
      at
    org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
      at
    org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
      at java.lang.Thread.run(Thread.java:744) Caused by:
    java.lang.NoSuchMethodError:
    org.hibernate.integrator.internal.IntegratorServiceImpl.(Ljava/util/LinkedHashSet;Lorg/hibernate/boot/registry/classloading/spi/ClassLoaderService;)V
      at
    org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:247)
      at
    org.hibernate.boot.registry.StandardServiceRegistryBuilder.(StandardServiceRegistryBuilder.java:73)
      at connectors.Connector.buildSessionFactory(Connector.java:21)  ...
    44 more Caused by:</p>
    
    <p>java.lang.NoSuchMethodError:
    org.hibernate.integrator.internal.IntegratorServiceImpl.(Ljava/util/LinkedHashSet;Lorg/hibernate/boot/registry/classloading/spi/ClassLoaderService;)V
      at
    org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:247)
      at
    org.hibernate.boot.registry.StandardServiceRegistryBuilder.(StandardServiceRegistryBuilder.java:73)
      at connectors.Connector.buildSessionFactory(Connector.java:21)  at
    connectors.Connector.getSessionFactory(Connector.java:37)     at
    connectors.Connector.getSession(Connector.java:45)    at
    mainproject.services.HibernateDatesTest.verifyToken(HibernateDatesTest.java:24)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)     at
    com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
      at
    com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
      at
    com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
      at
    com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
      at
    com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
      at
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      at
    com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
      at
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
      at
    com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
      at
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)     at
    org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
      at
    org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
      at
    org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
      at
    org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
      at
    org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
      at
    org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
      at
    org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
      at
    org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
      at
    org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
      at
    org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
      at
    org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
      at org.eclipse.jetty.server.Server.handle(Server.java:349)  at
    org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
      at
    org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
      at
    org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
      at
    org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
      at
    org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
      at
    org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
      at
    org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
      at
    org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
      at java.lang.Thread.run(Thread.java:744) Powered by Jetty://</p>
  </blockquote>
  
  <p>My session builder class:</p>
  
  <pre><code>package connectors;
  
  import org.hibernate.Session;
  import org.hibernate.SessionFactory;
  import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
  import org.hibernate.cfg.Configuration;
  import org.hibernate.service.ServiceRegistry;
  
  public class Connector {
  
      private static SessionFactory sessionFactory;
  
      private static SessionFactory buildSessionFactory() {
          try {
              // Create the SessionFactory from hibernate.cfg.xml
              Configuration configuration = new Configuration();
              configuration.configure("hibernate.cfg.xml");
              System.out.println("Hibernate Configuration loaded");
  
              //apply configuration property settings to StandardServiceRegistryBuilder
              StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
              System.out.println("Hibernate serviceRegistry created");
  
              SessionFactory sessionFactory = configuration.buildSessionFactory(ssrb.build());
  
  
              return sessionFactory;
          }
          catch (Throwable ex) {
              // Make sure you log the exception, as it might be swallowed
              System.err.println("Initial SessionFactory creation failed." + ex);
              throw new ExceptionInInitializerError(ex);
          }
      }
  
      public static SessionFactory getSessionFactory() {
          if(sessionFactory == null) sessionFactory = buildSessionFactory();
          return sessionFactory;
      }
  
  
  
  
      public static Session getSession(){
          return getSessionFactory().openSession();
      }
  }
  </code></pre>
  
  <p>My Pom.xml:</p>
  
  <blockquote>
    <p> http://maven.apache.org/xsd/maven-4.0.0.xsd">
        
            resueue-ws
            serverside
            1.0
        
        4.0.0</p>
  
  <pre><code>&lt;artifactId&gt;resqueue-mainproj&lt;/artifactId&gt; &lt;dependencies&gt;
  &lt;!-- our projects --&gt;
  
  
  &lt;dependency&gt;
      &lt;groupId&gt;serverside&lt;/groupId&gt;
      &lt;artifactId&gt;resqueue-dal&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;serverside&lt;/groupId&gt;
      &lt;artifactId&gt;resqueue-srdlib&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;!-- Jetty --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
      &lt;artifactId&gt;jetty-servlet&lt;/artifactId&gt;
      &lt;version&gt;7.6.0.v20120127&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
      &lt;artifactId&gt;jetty-webapp&lt;/artifactId&gt;
      &lt;version&gt;7.6.0.v20120127&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- Nimbus --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.nimbusds&lt;/groupId&gt;
      &lt;artifactId&gt;nimbus-jose-jwt&lt;/artifactId&gt;
      &lt;version&gt;2.9&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- Jersey --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
      &lt;version&gt;1.8&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-json&lt;/artifactId&gt;
      &lt;version&gt;1.8&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- jUnit --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;junit&lt;/groupId&gt;
      &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;version&gt;4.10&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;!--org.apache.http --&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
      &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
      &lt;version&gt;4.3.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- JSON LIB -&gt; added for testing only  --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
      &lt;artifactId&gt;gson&lt;/artifactId&gt;
      &lt;version&gt;2.2.4&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- Hibernate --&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;mysql&lt;/groupId&gt;
      &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
      &lt;version&gt;5.1.30&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
      &lt;version&gt;4.3.6.Final&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;!-- for JPA, use hibernate-entitymanager instead of hibernate-core --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
      &lt;version&gt;4.3.6.Final&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
    
    <p></p>
    
    <p></p>
  </blockquote>
  
  <p>I cleaned the maven repo from all other versions.
  Any ideas?</p>