title: Tomcat 8.5.35 server won't start due to java.lang.NoClassDefFoundError
body: <p>I am getting the following error when trying to start a tomcat server. I have the <a href="https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html" rel="nofollow noreferrer">Amazon Corretto 8 JDK</a> installed on a mac machine. I have also tried using Java 8u291 but I get the same exact error.</p>
  <pre><code>21-Apr-2021 11:15:44.977 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
   org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/repo_war_exploded]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
      at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1736)
      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:300)
      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:483)
      at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:432)
      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:300)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
      at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
      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 java.security.AccessController.doPrivileged(Native Method)
      at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
      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:573)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
      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: com/sun/image/codec/jpeg/JPEGImageEncoder
      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Class.java:2611)
      at java.lang.Class.getDeclaredFields(Class.java:1944)
      at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:110)
      at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:269)
      at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:137)
      at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:69)
      at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:328)
      at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:772)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      ... 44 more
  Caused by: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.JPEGImageEncoder
      at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1328)
      at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1156)
      ... 57 more
  
  21-Apr-2021 11:15:44.979 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception invoking method manageApp
   java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/repo_war_exploded]]
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
      at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1736)
      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:300)
      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:483)
      at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:432)
      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:300)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
      at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
      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 java.security.AccessController.doPrivileged(Native Method)
      at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
      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:573)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
      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)
  
  21-Apr-2021 11:15:44.980 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception invoking method createStandardContext
   javax.management.RuntimeOperationsException: Exception invoking method manageApp
      at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:308)
      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:483)
      at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:432)
      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:300)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
      at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
      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 java.security.AccessController.doPrivileged(Native Method)
      at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
      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:573)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
      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[/repo_war_exploded]]
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
      at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1736)
      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:300)
      ... 35 more
  </code></pre>
  <p>Blah blah blah, why do you do this SO, here are more details since you don't like &quot;code&quot;.</p>
  <p>Blah blah blah, why do you do this SO, here are more details since you don't like &quot;code&quot;.</p>
  <p>Blah blah blah, why do you do this SO, here are more details since you don't like &quot;code&quot;.</p>