title: Struts2 error while executing on tomcat
body: <p>I am new in struts and I try my first program but error display starting tomcat v9.0 at local host has encountered a problem I am tried many ways to solve this problem but not solve 
  My code are following also I am added all library still I get this error</p>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
    &lt;display-name&gt;StrutsEx1&lt;/display-name&gt;
  
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;filter&gt;
    &lt;filter-name&gt;Controller&lt;/filter-name&gt;
    &lt;filter-class&gt;org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt;
    &lt;/filter&gt;
    &lt;filter-mapping&gt;
   &lt;filter-name&gt;Controller&lt;/filter-name&gt;
    &lt;url-pattern&gt;*&lt;/url-pattern&gt;
    &lt;/filter-mapping&gt;
    &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>Adder.java</strong></p>
  
  <pre><code>package com.test;
  import com.opensymphony.xwork2.ActionSupport;
  public class Adder{
      int num1,num2,sum;
      public int getNum1() {
          return num1;
      }
      public void setNum1(int num1) {
          this.num1 = num1;    }
      public int getNum2() {
          return num2;
      }
      public void setNum2(int num2) {
          this.num2 = num2;    }
      public int getSum() {
          return sum;
      }
      public void setSum(int sum) {
          this.sum = sum;    }
      public String execute(){
          sum=num1+num2;
          return "success";}}
  </code></pre>
  
  <p><strong>struts.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;struts&gt;
  &lt;package name="first" extends="struts-default"&gt;
  &lt;action name="adder" class="com.test.Sample"&gt;
  &lt;result name="success"&gt;/result.jsp&lt;/result&gt;
  &lt;/action&gt;
  &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>
  
  <p><strong>index.jsp</strong></p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;%@taglib uri="/struts-tags" prefix="s" %&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;s:form action="adder"&gt;
  &lt;s:textfield name="num1" label="first no"/&gt;
  &lt;s:textfield name="num2" label="second no"/&gt;
  &lt;s:submit value="Add"/&gt;
  &lt;/s:form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>result.jsp</strong></p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;%@taglib uri="/struts-tags" prefix="s" %&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h3&gt;Sum is&lt;s:property value="Sum"/&gt;&lt;/h3&gt;&lt;hr/&gt;
  &lt;jsp:include page="index.jsp"/&gt;
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p>I am trying addition example but same error is getting to check server is proper or not I try simple JSP servlet example that work fine but for this example I getting error</p>
  
  <p>Following error I get</p>
  
  <pre><code>Aug 17, 2018 8:46:41 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
  WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:StrutsEx1' did not find a matching property.
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Server version:        Apache Tomcat/9.0.0.M22
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Server built:          Jun 21 2017 09:44:18 UTC
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Server number:         9.0.0.0
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: OS Name:               Windows 10
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: OS Version:            10.0
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Architecture:          amd64
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Java Home:             E:\Java\jre1.8
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: JVM Version:           1.8.0_101-b13
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: JVM Vendor:            Oracle Corporation
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: CATALINA_BASE:         E:\Shravan\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: CATALINA_HOME:         E:\Java\apache-tomcat-9.0.0.M22
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Command line argument: -Dcatalina.base=E:\Shravan\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Command line argument: -Dcatalina.home=E:\Java\apache-tomcat-9.0.0.M22
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Command line argument: -Dwtp.deploy=E:\Shravan\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Command line argument: -Djava.endorsed.dirs=E:\Java\apache-tomcat-9.0.0.M22\endorsed
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.VersionLoggerListener log
  INFO: Command line argument: -Dfile.encoding=Cp1252
  Aug 17, 2018 8:46:41 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [E:\Java\jre1.8\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;E:/Java/jre1.8/bin/server;E:/Java/jre1.8/bin;E:/Java/jre1.8/lib/amd64;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;E:\eclipse;;.]
  Aug 17, 2018 8:46:41 AM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["http-nio-82"]
  Aug 17, 2018 8:46:41 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
  INFO: Using a shared selector for servlet write/read
  Aug 17, 2018 8:46:41 AM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["ajp-nio-8011"]
  Aug 17, 2018 8:46:41 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
  INFO: Using a shared selector for servlet write/read
  Aug 17, 2018 8:46:41 AM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 2490 ms
  Aug 17, 2018 8:46:41 AM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service [Catalina]
  Aug 17, 2018 8:46:41 AM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/9.0.0.M22
  Aug 17, 2018 8:46:44 AM org.apache.catalina.core.ContainerBase startInternal
  SEVERE: A child container failed during start
  java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Example1]]
      at java.util.concurrent.FutureTask.report(Unknown Source)
      at java.util.concurrent.FutureTask.get(Unknown Source)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:947)
      at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
      at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:657)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Example1]]
      at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
      at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
      ... 21 more
  Caused by: java.lang.NoClassDefFoundError: Lorg/apache/logging/log4j/Logger;
      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Unknown Source)
      at java.lang.Class.getDeclaredFields(Unknown Source)
      at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:110)
      at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:262)
      at org.apache.catalina.startup.WebAnnotationSet.loadApplicationFilterAnnotations(WebAnnotationSet.java:108)
      at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
      at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:328)
      at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:778)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4993)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      ... 27 more
  Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.Logger
      at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1269)
      at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1104)
      ... 40 more
  
  Aug 17, 2018 8:46:44 AM org.apache.catalina.core.ContainerBase startInternal
  SEVERE: A child container failed during start
  java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
      at java.util.concurrent.FutureTask.report(Unknown Source)
      at java.util.concurrent.FutureTask.get(Unknown Source)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:947)
      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:657)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
  Caused by: org.apache.catalina.LifecycleException: A child container failed during start
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:956)
      at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
      at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
      ... 13 more
  
  Aug 17, 2018 8:46:44 AM org.apache.catalina.startup.Catalina start
  SEVERE: The required Server component failed to start so Tomcat is unable to start.
  org.apache.catalina.LifecycleException: A child container failed during start
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:956)
      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:657)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
  
  Aug 17, 2018 8:46:44 AM org.apache.coyote.AbstractProtocol pause
  INFO: Pausing ProtocolHandler ["http-nio-82"]
  Aug 17, 2018 8:46:44 AM org.apache.coyote.AbstractProtocol pause
  INFO: Pausing ProtocolHandler ["ajp-nio-8011"]
  Aug 17, 2018 8:46:44 AM org.apache.catalina.core.StandardService stopInternal
  INFO: Stopping service [Catalina]
  Aug 17, 2018 8:46:44 AM org.apache.coyote.AbstractProtocol destroy
  INFO: Destroying ProtocolHandler ["http-nio-82"]
  Aug 17, 2018 8:46:44 AM org.apache.coyote.AbstractProtocol destroy
  INFO: Destroying ProtocolHandler ["ajp-nio-8011"]
  </code></pre>