title: Severe exception on servlet with java.lang.NoClassDefFoundError
body: <p>I get this exception on my tomcat8 running on this java version OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)</p>
  
  <pre><code>SEVERE [http-nio-80-exec-9] 
  
  org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [restSdkService] in context with path [/RestService] threw exception [java.lang.NoClassDefFoundError: Could not initialize class com.example.bean.SomeBean] with root cause
   java.lang.NoClassDefFoundError: Could not initialize class com.example.bean.SomeBean at com.example.service.SomeService.getStuff(SomeService.java:118)
          at sun.reflect.GeneratedMethodAccessor451.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)
          at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
          at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
          at org.apache.wink.server.internal.handlers.CreateInvocationParametersHandler.handleRequest(CreateInvocationParametersHandler.java:54)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
          at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
          at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceMethod(FindResourceMethodHandler.java:183)
          at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:110)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
          at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
          at org.apache.wink.server.internal.handlers.FindRootResourceHandler.handleRequest(FindRootResourceHandler.java:95)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
          at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
          at org.apache.wink.server.internal.handlers.HeadMethodHandler.handleRequest(HeadMethodHandler.java:53)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
          at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
          at org.apache.wink.server.internal.handlers.OptionsMethodHandler.handleRequest(OptionsMethodHandler.java:46)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
          at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
          at org.apache.wink.server.internal.handlers.SearchResultHandler.handleRequest(SearchResultHandler.java:33)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
          at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
          at org.apache.wink.server.internal.log.ResourceInvocation.handleRequest(ResourceInvocation.java:92)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
          at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
          at org.apache.wink.server.internal.log.Requests.handleRequest(Requests.java:76)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
          at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
          at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
          at org.apache.wink.server.handlers.AbstractHandlersChain.run(AbstractHandlersChain.java:48)
          at org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:207)
          at org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)
          at org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:119)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.apache.wink.server.internal.servlet.contentencode.ContentEncodingResponseFilter.doFilter(ContentEncodingResponseFilter.java:122)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
          at psiprobe.Tomcat80AgentValve.invoke(Tomcat80AgentValve.java:40)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
          at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1504)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1460)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>and this is how my web.xml looks like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;!DOCTYPE web-app PUBLIC
          "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
          "http://java.sun.com/dtd/web-app_2_3.dtd" &gt;
  
  &lt;web-app&gt;
      &lt;display-name&gt;Wink SDK demo&lt;/display-name&gt;
      &lt;description&gt;Demonstration of SDK features&lt;/description&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;ContentEncodingResponseFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;org.apache.wink.server.internal.servlet.contentencode.ContentEncodingResponseFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;ContentEncodingResponseFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;com.example.listener.ApplicationLifeCycleListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;restSdkService&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.apache.wink.server.internal.servlet.RestServlet&lt;/servlet-class&gt;
  
          &lt;init-param&gt;
              &lt;param-name&gt;applicationConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/application&lt;/param-value&gt;
          &lt;/init-param&gt;
  
          &lt;init-param&gt;
              &lt;param-name&gt;propertiesLocation&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/bookmarks.properties&lt;/param-value&gt;
          &lt;/init-param&gt;
  
          &lt;init-param&gt;
              &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
              &lt;param-value&gt;com.example.WinkApplication&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;restSdkService&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>and here is my pom.xml:</p>
  
  <pre><code>&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;de.some.service&lt;/groupId&gt;
      &lt;artifactId&gt;RestService&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;version&gt;current-SNAPSHOT&lt;/version&gt;
  
  
      &lt;parent&gt;
          &lt;groupId&gt;de.some.parent&lt;/groupId&gt;
          &lt;artifactId&gt;parent&lt;/artifactId&gt;
          &lt;version&gt;current-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
              &lt;artifactId&gt;lombok&lt;/artifactId&gt;
              &lt;version&gt;${lombok.version}&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.wink&lt;/groupId&gt;
              &lt;artifactId&gt;wink-server&lt;/artifactId&gt;
              &lt;version&gt;1.1.3-incubating&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.wink&lt;/groupId&gt;
              &lt;artifactId&gt;wink-client&lt;/artifactId&gt;
              &lt;version&gt;1.1.3-incubating&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;artifactId&gt;mongo-java-driver&lt;/artifactId&gt;
              &lt;groupId&gt;org.mongodb&lt;/groupId&gt;
              &lt;version&gt;${mongo-java-driver.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;de.some.entities&lt;/groupId&gt;
              &lt;artifactId&gt;someinternalentities&lt;/artifactId&gt;
              &lt;version&gt;current-SNAPSHOT&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;asm&lt;/groupId&gt;
                      &lt;artifactId&gt;asm&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;de.some.utils&lt;/groupId&gt;
              &lt;artifactId&gt;someinternalutils&lt;/artifactId&gt;
              &lt;version&gt;current-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;de.some.lib&lt;/groupId&gt;
              &lt;artifactId&gt;someinternallib&lt;/artifactId&gt;
              &lt;version&gt;current-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.module&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-module-jaxb-annotations&lt;/artifactId&gt;
              &lt;version&gt;2.7.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.5-20081211&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
              &lt;version&gt;${slf4j.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;${slf4j.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;apache-log4j-extras&lt;/artifactId&gt;
              &lt;version&gt;1.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;net.sf.cron4j&lt;/groupId&gt;
              &lt;artifactId&gt;cron4j&lt;/artifactId&gt;
              &lt;version&gt;2.2.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- JETTY DEPENDENCIES FOR TESTING --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
              &lt;artifactId&gt;jetty&lt;/artifactId&gt;
              &lt;version&gt;6.1.25&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
              &lt;artifactId&gt;jetty-util&lt;/artifactId&gt;
              &lt;version&gt;6.1.25&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
              &lt;artifactId&gt;jetty-management&lt;/artifactId&gt;
              &lt;version&gt;6.1.25&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.mail&lt;/groupId&gt;
              &lt;artifactId&gt;mail&lt;/artifactId&gt;
              &lt;version&gt;1.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;de.some.internal.library&lt;/groupId&gt;
              &lt;artifactId&gt;someinternal-svc&lt;/artifactId&gt;
              &lt;version&gt;current-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- JUNIT DEPENDENCY FOR TESTING --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;${junit.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- https://mvnrepository.com/artifact/asm/asm-attrs --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;asm&lt;/groupId&gt;
              &lt;artifactId&gt;asm-attrs&lt;/artifactId&gt;
              &lt;version&gt;2.2.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;filtering&gt;false&lt;/filtering&gt;
                  &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;/resource&gt;
              &lt;resource&gt;
                  &lt;filtering&gt;false&lt;/filtering&gt;
                  &lt;directory&gt;src/main/java&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**&lt;/include&gt;
                  &lt;/includes&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;**/*.java&lt;/exclude&gt;
                  &lt;/excludes&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
          &lt;testResources&gt;
              &lt;testResource&gt;
                  &lt;directory&gt;src/main/config&lt;/directory&gt;
                  &lt;filtering&gt;true&lt;/filtering&gt;
              &lt;/testResource&gt;
              &lt;testResource&gt;
                  &lt;filtering&gt;false&lt;/filtering&gt;
                  &lt;directory&gt;src/test/java&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**&lt;/include&gt;
                  &lt;/includes&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;**/*.java&lt;/exclude&gt;
                  &lt;/excludes&gt;
              &lt;/testResource&gt;
          &lt;/testResources&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;inherited&gt;true&lt;/inherited&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                      &lt;optimize&gt;true&lt;/optimize&gt;
                      &lt;debug&gt;true&lt;/debug&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;addDefaultImplementationEntries&gt;true&lt;/addDefaultImplementationEntries&gt;
                              &lt;addDefaultSpecificationEntries&gt;true&lt;/addDefaultSpecificationEntries&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                      &lt;archiveClasses&gt;true&lt;/archiveClasses&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Does anybody have any clue why this is happening?</p>