title: cxf and spring MVC : No service was found
body: <p>I have spring application, in which I use org.apache.cxf for soap and spring MVC for displayng some pages.
  My <code>web.xml</code> contains two servlets :<code>CXFServlet and mvc-dispatcher</code> </p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.apache.cxf.transport.servlet.CXFServlet&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;CXFServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;WEB-INF/servlet-context.xml&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;mvc-dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/hello&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>When I has been used <code>@ResponseBody</code> in my controller everything was fine.</p>
  
  <pre><code>@Controller
  @RequestMapping("/hello")
  @ResponseBody
  public class HelloController {
      @RequestMapping(method = RequestMethod.GET)
      public String printWelcome() {       
          return "hello" ;
      }
  }
  </code></pre>
  
  <p>but then i was needed to use jsp I have to use the following </p>
  
  <pre><code>@Controller
  @RequestMapping("/hello")
  public class HelloController {
      @RequestMapping(method = RequestMethod.GET)
      public ModelAndView printWelcome(ModelMap model) {
          model.addAttribute("message", "hello");
          return new ModelAndView("hello") ;
      }
  }
  </code></pre>
  
  <p>and  when I request <code>http://localhost:8080/hello</code> I get "No service was found" instead of  "hello"</p>
  
  <p>I found that if I delete following from web.xml</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.apache.cxf.transport.servlet.CXFServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
   &lt;servlet&gt;
      &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.apache.cxf.transport.servlet.CXFServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  </code></pre>
  
  <p>my controller works fine.</p>