title: Resource Configuration class could not be loaded - Jersey
body: <p>I had developed a server code following the <code>RESTful</code> architecture few months back. The server code is hosted on a cloud service and it was working as expected till yesterday. I opened the <code>Eclipse IDE</code> to make few changes on the server code (just adding few java classes) and there was an automatic update to my server code on the cloud and the local Tomcat server.</p>
  
  <p>I suddenly find my endpoints not working and I get the following exception:</p>
  
  <pre><code>javax.servlet.ServletException: Resource configuration class
   org.abc.def.gh.MyApplication could not be loaded.
      org.glassfish.jersey.servlet.WebComponent.createResourceConfig(WebComponent.java:502)
      org.glassfish.jersey.servlet.WebComponent.&lt;init(WebComponent.java:324)
      org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:170)
      org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:358)
      javax.servlet.GenericServlet.init(GenericServlet.java:160)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
      org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
      java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      java.lang.Thread.run(Unknown Source)
  
  
  
   root cause  java.lang.ClassNotFoundException:
   org.abc.def.gh.MyApplication
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
      java.lang.Class.forName0(Native Method)
      java.lang.Class.forName(Unknown Source)
      org.glassfish.jersey.internal.util.ReflectionHelper$7.run(ReflectionHelper.java:404)
      org.glassfish.jersey.internal.util.ReflectionHelper$7.run(ReflectionHelper.java:394)
      java.security.AccessController.doPrivileged(Native Method)
      org.glassfish.jersey.servlet.WebComponent.createResourceConfig(WebComponent.java:489)
      org.glassfish.jersey.servlet.WebComponent.&lt;init(WebComponent.java:324)
      org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:170)
      org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:358)
      javax.servlet.GenericServlet.init(GenericServlet.java:160)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
      org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
      java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>, where MyApplication is registered the following way in <code>web.xml</code>:</p>
  
  <pre><code>    &lt;init-param&gt;
          &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
          &lt;param-value&gt;org.abc.def.gh.MyApplication&lt;/param-value&gt;
      &lt;/init-param&gt;
  </code></pre>
  
  <p>I have not made any changes both to my <code>web.xml</code> and <code>pom.xml</code> files. I'm finding it hard to analyse the cause of this sudden issue. </p>
  
  <p>I appreciate your help!
  Thanks.</p>