title: The Struts dispatcher cannot be found in struts2
body: <p>initially my jsp page is showed in proper way when i click on submit button it is showing class not found exception for sql library but then i add mysql library it is not showng jsp page and giving exception </p>
  
  <p><code>org.apache.jasper.JasperException: The Struts dispatcher cannot be found.  This is 
   usually caused by using Struts tags without the associated filter. Struts tags are 
   only usable when the request has passed through its servlet filter, which initializes
   the Struts dispatcher needed for this tag. - [unknown location]</code></p>
  
  <p>root cause</p>
  
  <blockquote>
    <p>The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag.</p>
  </blockquote>
  
  <p>Please help me to resolve this</p>
  
  <p>web.xml</p>
  
  <pre class="lang-xml prettyprint-override"><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" 
           xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
           id="WebApp_ID" 
           version="2.5"&gt;
  
    &lt;display-name&gt;Struts2Example17&lt;/display-name&gt;
    &lt;filter&gt;
          &lt;filter-name&gt;struts2&lt;/filter-name&gt;
          &lt;filter-class&gt;
              org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;struts2&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>this error is also coming</p>
  
  <pre><code>SEVERE: log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
  SEVERE: log4j:WARN No appenders could be found for logger (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider).
  SEVERE: log4j:WARN Please initialize the log4j system properly.
  SEVERE: WebModule[/Struts2Example17]PWC1270: Exception starting filter struts2
  </code></pre>
  
  <p>errortrace</p>
  
  <pre><code>SEVERE: log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
  SEVERE: log4j:WARN No appenders could be found for logger (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider).
  SEVERE: log4j:WARN Please initialize the log4j system properly.
  SEVERE: WebModule[/Struts2Example17]PWC1270: Exception starting filter struts2
  java.lang.InstantiationException
      at org.apache.catalina.core.ApplicationFilterConfig.&lt;init&gt;(ApplicationFilterConfig.java:124)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
      at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2000)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1651)
      at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
      at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
      at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
      at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:360)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
      at org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:126)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
      at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
      at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: Unable to load configuration. - bean - jar:file:/D:/strts2/Struts2Example17/build/web/WEB-INF/lib/struts2-dojo-plugin-2.1.8-sources.jar!/struts-plugin.xml:29:119
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
      at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
      at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
      at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
      at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:48)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
      at org.apache.catalina.core.ApplicationFilterConfig.&lt;init&gt;(ApplicationFilterConfig.java:120)
      ... 47 more
  Caused by: Unable to load bean: type:org.apache.struts2.views.TagLibrary class:org.apache.struts2.dojo.views.DojoTagLibrary - bean - jar:file:/D:/strts2/Struts2Example17/build/web/WEB-INF/lib/struts2-dojo-plugin-2.1.8-sources.jar!/struts-plugin.xml:29:119
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:222)
      at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
      at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:165)
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
      ... 53 more
  Caused by: java.lang.ClassNotFoundException: org.apache.struts2.dojo.views.DojoTagLibrary
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1519)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1369)
      at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:146)
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:193)
      ... 56 more
  </code></pre>
  
  <p>JSp file</p>
  
  <pre><code> &lt;%-- 
          Document   : statusdonationjsp
          Created on : Dec 20, 2011, 10:34:09 PM
          Author     : bhavishya
      --%&gt;
  
      &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
      &lt;%@taglib uri="/struts-tags" prefix="s"%&gt;
      &lt;!DOCTYPE html&gt;
      &lt;html&gt;
          &lt;head&gt;
              &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
              &lt;title&gt;Pending Donation &lt;/title&gt;
  
          &lt;/head&gt;
          &lt;body&gt;
  
          Search String
                &lt;s:form action="FindPendingDonation"&gt;
          &lt;s:textfield name="detail" label="Name" /&gt;
              &lt;s:select name="amounttype" list="{'Cash','Cheque'}" label="Paymet type" id="type" onchange="displayBlock()" /&gt;
              &lt;s:select name="status" list="{'Paid','Unpaid'}" label="Status(Cash)" /&gt;
          &lt;s:textfield name="amount" label="Amount" /&gt;
              &lt;s:textfield name="responsibleparty" label="Bank Name/Responsible party"  id="cash" /&gt;
              &lt;s:textfield name="chequeno" lable ="Cheque NO" id="chequeno"/&gt;
  
              &lt;s:submit /&gt;
      &lt;/s:form&gt;
  
          &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>