title: Glassfish 404 error for Spring project
body: <p>I have <strong>Glassfish3</strong> server which is integrated with <strong>Eclipse Helios</strong> </p>
  
  <p>I have added my sample Spring project to server using Add and Remove by right clicking server.</p>
  
  <p>When I run <code>http://localhost:8080/SpringHibernateJSFTest/insertJdbcContact.do</code></p>
  
  <p>I am getting <code>description The requested resource () is not available.</code></p>
  
  <p>How can I resolve this error? What am I doing wrong?</p>
  
  <p>Any help is highly appreciated.</p>
  
  <p>My <code>controller class</code>   </p>
  
  <pre><code> @Controller
  public class JBTJdbcController {
      @Autowired
      com.service.SpringJdbcService mfssService;
      @RequestMapping(value = "/insertJdbcContact", method = RequestMethod.GET)
      public ModelAndView insertMemDtls() {
          ModelAndView mav = new ModelAndView("JdbcInsert");
          VngMem mfssbean = new VngMem();
          mav.addObject("insertUser", mfssbean);
          mav.addObject("status", "success");
          return mav;
      }
      @RequestMapping(value = "/insertJdbcContact", method = RequestMethod.POST)
      public ModelAndView insertContact(
              @ModelAttribute("insertUser") VngMem vngmem) {
          ModelAndView mav = new ModelAndView("JdbcInsert");
          try {
              mfssService.insertMfssMemDts(vngmem);
          } catch (Exception e) {
              e.printStackTrace();
          }
          mav.addObject("searchResultPost", vngmem);
          return mav;
      }
  }
  </code></pre>
  
  <p>Here is <strong>web.xml</strong></p>
  
  <pre><code>&lt;display-name&gt;SpringHibernateJSFTest&lt;/display-name&gt;
      &lt;display-name&gt;SpringMVC&lt;/display-name&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;welcome.do&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;classpath:applicationContext.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>My <strong>applicationContext.xml</strong></p>
  
  <pre><code>&lt;context:annotation-config /&gt;
  &lt;context:component-scan base-package="com.controller,com.beans" /&gt;
  &lt;mvc:annotation-driven /&gt;
    &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
          &lt;property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/&gt;
          &lt;property name="url" value="jdbc:oracle:thin:@server:1521:orcl"/&gt;
          &lt;property name="username" value="scott"/&gt;
          &lt;property name="password" value="tiger"/&gt;
  
      &lt;/bean&gt;
  &lt;bean id="SpringJdbcDao"  class="com.dao.SpringJdbcDaoImpl"&gt;
    &lt;property name="dataSource" ref="dataSource"/&gt;
  &lt;/bean&gt;
    &lt;bean id="SpringJdbcService"  class="com.service.SpringJdbcServiceImpl"&gt;
    &lt;property name="springJdbcDao" ref="SpringJdbcDao"/&gt;
  &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>My <strong>dispatcher-servlet.xml</strong></p>
  
  <pre><code> &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
                  &lt;property name="prefix" value="/WEB-INF/jsp/"/&gt;
          &lt;property name="suffix" value=".jsp"/&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>I have <code>JdbcInsert.jsp</code> in <code>/WebContent/WEB-INF</code></p>
  
  <p>Update 1</p>
  
  <pre><code>cannot Deploy SpringHibernateJSFTest
  Deployment Error for module: SpringHibernateJSFTest: Exception while loading the app :
  java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: 
  org.apache.catalina.LifecycleException: 
  org.springframework.beans.factory.BeanDefinitionStoreException: 
  IOException parsing XML document from class path resource [applicationContext.xml];
   nested exception is java.io.FileNotFoundException: class path resource 
   [applicationContext.xml] cannot be opened because it does not exist
  </code></pre>