title: javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config.xml
body: <p>I am new to Struts and I am trying to run a sample login web-application using Struts but I am unable to get the result due to <code>(javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config.xml)</code> the error. I had done everything in configuring struts in eclipse. I even don't no what the exception is? please anyone help me  </p>
  
  <p><strong>the errors I am getting are:</strong></p>
  
  <pre><code>javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config.xml
  at org.apache.struts.action.ActionServlet.splitAndResolvePaths(ActionServlet.java:1872)
  at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:683)
  at org.apache.struts.action.ActionServlet.init(ActionServlet.java:356)
  at javax.servlet.GenericServlet.init(GenericServlet.java:212)
  at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213)
  at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
  at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
  at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
  at org.apache.catalina.core.StandardService.start(StandardService.java:525)
  at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
  at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
  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:289)
  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 
  </code></pre>
  
  <p><strong><code>index.jsp</code>:</strong></p>
  
  <pre><code>&lt;html&gt; 
      &lt;body&gt;
  
  
          &lt;form action="login.do"&gt;
         &lt;tr&gt;
         &lt;td&gt;Username&lt;/td&gt; 
         &lt;td&gt;&lt;input type = "text" name = "username" maxlength = "25"&gt;&lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr&gt;
         &lt;td&gt;Password&lt;/td&gt;
         &lt;td&gt;&lt;input type = "password" name = "password" minlength = "8" maxlength = "16"&gt;&lt;/td&gt;
         &lt;/tr&gt;
  
         &lt;tr&gt;
         &lt;td  colspan = "2" align = "center"&gt;&lt;button type = "submit" name = "submit"&gt;Submit&lt;/button&gt;
         &lt;button type = "reset"   name = "reset"&gt;Reset&lt;/button&gt;&lt;/td&gt;
  
         &lt;/tr&gt;
  
  
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong><code>LoginForm.java</code>:</strong></p>
  
  <pre><code>package com.sample.com;
  
  import org.apache.struts.action.ActionForm;
  
  import org.apache.struts.action.Action;
  
  import org.apache.struts.action.ActionMapping;
  
  import org.apache.struts.action.ActionForward;
  
  import javax.servlet.http.HttpServletRequest;
  
  import javax.servlet.http.HttpServletResponse;
  
  public class LoginAction extends Action {
  
      public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res)
      {
          System.out.println("test");
  
      LoginForm login = (LoginForm)form;
  
      String uname=login.getUname();
  
      String pass=login.getPass();
  
      if(uname=="admin" &amp;&amp; pass =="test")
      {
      return mapping.findForward("success");
  
      }
      else
      {
      return mapping.findForward("failure");
  
      }
    }
  }
  </code></pre>
  
  <p><strong><code>LoginAction.java</code>:</strong></p>
  
  <pre><code>package com.sample.com;
  
  import org.apache.struts.action.ActionForm;
  
  import org.apache.struts.action.Action;
  
  import org.apache.struts.action.ActionMapping;
  
  import org.apache.struts.action.ActionForward;
  
  import javax.servlet.http.HttpServletRequest;
  
  import javax.servlet.http.HttpServletResponse;
  
  
  
  public class LoginAction extends Action {
  
      public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res)
      {
  
          System.out.println("test");
  
      LoginForm login = (LoginForm)form;
  
      String uname=login.getUname();
  
      String pass=login.getPass();
  
      if(uname=="admin" &amp;&amp; pass =="test")
      {
      return mapping.findForward("success");
      }
      else
      {
      return mapping.findForward("failure");
  
      }
  
    }
  
  
  }
  </code></pre>
  
  <p><strong><code>config-struts.xml</code>:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  
  
  
  &lt;struts-config&gt;
  
      &lt;form-beans&gt;
          &lt;form-bean name="loginRequest" type="com.sample.com.LoginForm"/&gt;
      &lt;/form-beans&gt; 
  
      &lt;global-forwards&gt;
          &lt;forward name="success"  path="/success.jsp"/&gt;
      &lt;/global-forwards&gt;
  
      &lt;action-mappings&gt;
          &lt;action path="/login" type="com.sample.com.LoginAction" name="loginRequest"&gt;
              &lt;forward name="success" path="/success.jsp"/&gt;
              &lt;forward name="failure" path="/failure.jsp"/&gt;        
          &lt;/action&gt;
      &lt;/action-mappings&gt;
  
  &lt;/struts-config&gt;
  </code></pre>
  
  <p><strong><code>web.xml</code>:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;action&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.apache.struts.action.ActionServlet&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;config&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/struts-config.xml&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;debug&lt;/param-name&gt;
              &lt;param-value&gt;2&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;detail&lt;/param-name&gt;
              &lt;param-value&gt;2&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;action&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              30
          &lt;/session-timeout&gt;
      &lt;/session-config&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>