title: Unable to load Spring MVC Application with Mixing of XML and JavaConfig
body: <p>I have an old application which is SPRING MVC application  with xml based configuration. Due to some reasons i have modified it as Spring MVC application with XML and Java Configuration.
      I referred below two links</p>
  
  <ol>
  <li><p><a href="https://www.mkyong.com/spring/spring-mixing-xml-and-javaconfig/" rel="nofollow noreferrer">https://www.mkyong.com/spring/spring-mixing-xml-and-javaconfig/</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/19365366/mixing-xml-and-java-config-with-spring">Mixing xml and java config with spring</a></p></li>
  </ol>
  
  <p>But it is not working , i guess i am missing something. Please go through the below code:-</p>
  
  <pre><code>1.        web.xml  -- Please refer below the web.xml file.
                              &lt;?xml version="1.0" encoding="UTF-8"?&gt;
                              &lt;web-app 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"
                                  version="3.0"&gt;
                                  &lt;display-name&gt;spring-tutorial-mvc&lt;/display-name&gt;
                                  &lt;welcome-file-list&gt;
                                      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;     
                                  &lt;/welcome-file-list&gt;
                                  &lt;context-param&gt;
                                      &lt;param-name&gt;contextClass&lt;/param-name&gt;
                                      &lt;param-value&gt;
                                          org.springframework.web.context.support.AnnotationConfigWebApplicationContext
                                      &lt;/param-value&gt;
                                  &lt;/context-param&gt;
                              &lt;/web-app&gt;
  
                      2. mvc-config.xml :- Please refer below the dispacter servlet file.                 
                      &lt;?xml version="1.0" encoding="UTF-8"?&gt;        
                      &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                          xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
                          xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
                              http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                              http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"&gt;        
                          &lt;context:component-scan base-package="com.org.smrs"/&gt;                 
                          &lt;mvc:annotation-driven /&gt;       
                          &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
  
                                  &lt;property name="prefix" value="/view/"/&gt;
                                  &lt;property name="suffix" value=".jsp"/&gt;
                          &lt;/bean&gt;         
                          &lt;mvc:resources mapping="/resources/**" location="/resources/" cache-period="31556926"/&gt;         
                      &lt;/beans&gt;
  
              3. app-ctx.xml - Please refer below the application context file.
              &lt;beans xmlns="http://www.springframework.org/schema/beans"
                  xmlns:context="http://www.springframework.org/schema/context"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
                  xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
                  xsi:schemaLocation=" 
                 http://www.springframework.org/schema/beans     
                 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                 http://www.springframework.org/schema/context 
                 http://www.springframework.org/schema/context/spring-context-3.0.xsd
                 http://www.springframework.org/schema/aop 
                 http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
                 http://www.springframework.org/schema/tx
                      http://www.springframework.org/schema/tx/spring-tx.xsd"&gt;
                  &lt;context:component-scan base-package="com.mpmvvcl.smrs" /&gt;
  
                  &lt;bean id="propertyConfigurer"
                      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
                      p:location="/WEB-INF/local.properties" /&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:@host:port:sid" /&gt;
                      &lt;property name="username" value="uname" /&gt;
                      &lt;property name="password" value="pwd" /&gt;
                  &lt;/bean&gt;     
              &lt;/beans&gt;
  
          4.AppConfig.java :- The java configuration file to load the configurations
          ----------------                 
          @Configuration
          @ImportResource({ "classpath:mvc-config.xml", "classpath:app-ctx.xml" })
          public class AppConfig {
  
          }
  
      5. ConsumerDetailController : Controller class 
      ---------------------------
      @Controller
      @RequestMapping(value = "/user/ca")
      public class ConsumerDetailController {
  
          // -------------------Retrieve All  
          @RequestMapping(value = "/consumer_list/", method = RequestMethod.GET)
          public ModelAndView getConsDetail() {
              ModelAndView mav = new ModelAndView("smrs/consumer_detail");
  
              return mav;
          }
  
      }
  
      But when I hit url http://localhost:8080/Web/user/ca/consumer_list/  in browser i get 404 page . Please advice. Here i don't want to change to complete java configuration. 
  </code></pre>