title: NoclassDefFoundError with Maven
body: <p>I'm trying to use Hibernate with Maven but I'm getting an error. It seems it's caused by <code>Caused by: java.lang.NoClassDefFoundError: org/hibernate/HibernateException</code> but I have the dependency on my pom.xml. So what's the problem??</p>
  
  <p>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/xsd/maven-4.0.0.xsd"&gt;
          &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  
  &lt;groupId&gt;com.atp&lt;/groupId&gt;
  &lt;artifactId&gt;ATP_UI&lt;/artifactId&gt;
  &lt;version&gt;1.0-0&lt;/version&gt;
  
  &lt;properties&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;5.2.10.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.docker-java&lt;/groupId&gt;
          &lt;artifactId&gt;docker-java&lt;/artifactId&gt;
          &lt;!-- use latest version https://github.com/docker-java/docker-java/releases --&gt;
          &lt;version&gt;3.0.14&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
          &lt;version&gt;3.0.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- https://mvnrepository.com/artifact/org.gitlab/java-gitlab-api --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.gitlab&lt;/groupId&gt;
          &lt;artifactId&gt;java-gitlab-api&lt;/artifactId&gt;
          &lt;version&gt;1.2.8&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-lang&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p></p>
  
  <p>ERROR:</p>
  
  <blockquote>
    <p>Connected to server [2017-10-23 09:58:56,822] Artifact ATP_UI:war
    exploded: Artifact is being deployed, please wait... out 23, 2017
    9:58:56 AM org.apache.catalina.deploy.WebXml setVersion WARNING:
    Unknown version string [3.1]. Default version will be used. out 23,
    2017 9:58:57 AM org.apache.catalina.core.ContainerBase
    addChildInternal SEVERE: ContainerBase.addChild: start: 
    org.apache.catalina.LifecycleException: Failed to start component
    [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
      at
    org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
      at
    org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1015)
      at
    org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:991)
      at
    org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
      at
    org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1899)
      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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
      at
    com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      at
    com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
      at
    org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
      at
    org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
      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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
      at
    com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      at
    com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
      at
    javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
      at
    javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
      at
    javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
      at
    javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
      at
    javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
      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
    sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
      at sun.rmi.transport.Transport$1.run(Transport.java:200)    at
    sun.rmi.transport.Transport$1.run(Transport.java:197)     at
    java.security.AccessController.doPrivileged(Native Method)    at
    sun.rmi.transport.Transport.serviceCall(Transport.java:196)   at
    sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
      at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
      at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
      at java.security.AccessController.doPrivileged(Native Method)   at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
      at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748) Caused by:
    java.lang.NoClassDefFoundError: org/hibernate/HibernateException  at
    java.lang.Class.getDeclaredFields0(Native Method)     at
    java.lang.Class.privateGetDeclaredFields(Class.java:2583)     at
    java.lang.Class.getDeclaredFields(Class.java:1916)    at
    org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
      at
    org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:270)
      at
    org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:139)
      at
    org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
      at
    org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:417)
      at
    org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:891)
      at
    org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
      at
    org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
      at
    org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
      at
    org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5519)
      at
    org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
      ... 42 more Caused by: java.lang.ClassNotFoundException:
    org.hibernate.HibernateException  at
    org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
      at
    org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
      ... 56 more</p>
    
    <p>out 23, 2017 9:58:57 AM org.apache.tomcat.util.modeler.BaseModelMBean
    invoke SEVERE: Exception invoking method manageApp
    java.lang.IllegalStateException: ContainerBase.addChild: start:
    org.apache.catalina.LifecycleException: Failed to start component
    [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
      at
    org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1019)
      at
    org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:991)
      at
    org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
      at
    org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1899)
      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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
      at
    com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      at
    com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
      at
    org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
      at
    org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
      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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
      at
    com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      at
    com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
      at
    javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
      at
    javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
      at
    javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
      at
    javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
      at
    javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
      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
    sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
      at sun.rmi.transport.Transport$1.run(Transport.java:200)    at
    sun.rmi.transport.Transport$1.run(Transport.java:197)     at
    java.security.AccessController.doPrivileged(Native Method)    at
    sun.rmi.transport.Transport.serviceCall(Transport.java:196)   at
    sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
      at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
      at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
      at java.security.AccessController.doPrivileged(Native Method)   at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
      at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)</p>
    
    <p>out 23, 2017 9:58:57 AM org.apache.tomcat.util.modeler.BaseModelMBean
    invoke SEVERE: Exception invoking method createStandardContext
    javax.management.RuntimeOperationsException: Exception invoking method
    manageApp     at
    org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:309)
      at
    com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      at
    com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
      at
    org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
      at
    org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
      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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
      at
    com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      at
    com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
      at
    javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
      at
    javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
      at
    javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
      at
    javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
      at
    javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
      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
    sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
      at sun.rmi.transport.Transport$1.run(Transport.java:200)    at
    sun.rmi.transport.Transport$1.run(Transport.java:197)     at
    java.security.AccessController.doPrivileged(Native Method)    at
    sun.rmi.transport.Transport.serviceCall(Transport.java:196)   at
    sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
      at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
      at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
      at java.security.AccessController.doPrivileged(Native Method)   at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
      at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748) Caused by:
    java.lang.IllegalStateException: ContainerBase.addChild: start:
    org.apache.catalina.LifecycleException: Failed to start component
    [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
      at
    org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1019)
      at
    org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:991)
      at
    org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
      at
    org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1899)
      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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
      ... 33 more</p>
  </blockquote>