title: java.lang.NoSuchFieldError: REFLECTION While deploying on Tomcat 7.0.78
body: <p>I am creating web service application (REST Producer) and while deploying on server, I am seeing below exception.</p>
  
  <pre><code>  SEVERE: StandardWrapper.Throwable
  java.lang.NoSuchFieldError: REFLECTION
      at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.&lt;init&gt;(RuntimeModelBuilder.java:93)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:473)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.&lt;init&gt;(JAXBContextImpl.java:319)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1170)
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:236)
      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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:172)
      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132)
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:334)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:431)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:394)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:298)
      at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.&lt;init&gt;(WadlApplicationContextImpl.java:72)
      at com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:97)
      at com.sun.jersey.server.impl.application.RootResourceUriRules.initWadl(RootResourceUriRules.java:169)
      at com.sun.jersey.server.impl.application.RootResourceUriRules.&lt;init&gt;(RootResourceUriRules.java:106)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1298)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:169)
      at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:775)
      at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:771)
      at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:771)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:766)
      at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
      at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
      at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)
      at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
      at javax.servlet.GenericServlet.init(GenericServlet.java:158)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1269)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1182)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1072)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5368)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5660)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
  
  Jul 13, 2017 11:14:28 AM org.apache.catalina.core.StandardContext loadOnStartup
  SEVERE: Servlet [jersey-servlet] in web application [/InventoryAPIProducer] threw load() exception
  java.lang.NoSuchFieldError: REFLECTION
      at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.&lt;init&gt;(RuntimeModelBuilder.java:93)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:473)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.&lt;init&gt;(JAXBContextImpl.java:319)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1170)
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:236)
      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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:172)
      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132)
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:334)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:431)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:394)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:298)
      at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.&lt;init&gt;(WadlApplicationContextImpl.java:72)
      at com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:97)
      at com.sun.jersey.server.impl.application.RootResourceUriRules.initWadl(RootResourceUriRules.java:169)
      at com.sun.jersey.server.impl.application.RootResourceUriRules.&lt;init&gt;(RootResourceUriRules.java:106)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1298)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:169)
      at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:775)
      at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:771)
      at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:771)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:766)
      at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
      at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
      at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)
      at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
      at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
      at javax.servlet.GenericServlet.init(GenericServlet.java:158)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1269)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1182)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1072)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5368)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5660)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>Below 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/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mkyong.common&lt;/groupId&gt;
      &lt;artifactId&gt;InventoryAPIProducer&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;InventoryAPIProducer&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;swagger-annotations-version&gt;1.5.13&lt;/swagger-annotations-version&gt;
          &lt;jodatime-version&gt;2.9.9&lt;/jodatime-version&gt;
          &lt;squareup-version&gt;2.7.5&lt;/squareup-version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.12&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.17&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api --&gt;
          &lt;!-- add slf4j interfaces to classpath --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.6.4&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
              &lt;version&gt;1.6.4&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&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;1.6.4&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.swagger&lt;/groupId&gt;
              &lt;artifactId&gt;swagger-annotations&lt;/artifactId&gt;
              &lt;version&gt;${swagger-annotations-version}&lt;/version&gt;
          &lt;/dependency&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;dependency&gt;
              &lt;groupId&gt;joda-time&lt;/groupId&gt;
              &lt;artifactId&gt;joda-time&lt;/artifactId&gt;
              &lt;version&gt;${jodatime-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.squareup.okhttp&lt;/groupId&gt;
              &lt;artifactId&gt;okhttp&lt;/artifactId&gt;
              &lt;version&gt;${squareup-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.squareup.okhttp&lt;/groupId&gt;
              &lt;artifactId&gt;logging-interceptor&lt;/artifactId&gt;
              &lt;version&gt;${squareup-version}&lt;/version&gt;
          &lt;/dependency&gt;       
          &lt;dependency&gt;
              &lt;groupId&gt;com.owlike&lt;/groupId&gt;
              &lt;artifactId&gt;genson&lt;/artifactId&gt;
              &lt;version&gt;1.4&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;finalName&gt;InventoryAPIProducer&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&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;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I referred similar issue on this forum but none of the solution worked for me. This issue is mostly related to CXF framework (As suggestion in other post) but I am not using it.</p>
  
  <p>I tried adding Server Runtime as Library but not resolved.</p>
  
  <p>Can anyone please help me how to resolve it?</p>
  
  <p>Thanks in Advance.</p>