title: CXF + Spring: No root resource matching request path has been found
body: <p>Trying to get a REST service with CXF and Spring up and running and I hit this wall. Everything else looks fine since I can access my /services/ page and see MyService listed under the REST services. I can view the WADL of the service just fine, with my method appearing there. When I try to access it though, exception occurs.</p>
  
  <pre><code>WARNING: No root resource matching request path /testApp/services/MyService/goTest has been found, Relative Path: /goTest. Please enable FINE/TRACE log level for more details.
  Jul 19, 2016 4:30:50 PM org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper toResponse
  WARNING: javax.ws.rs.NotFoundException: HTTP 404 Not Found
  </code></pre>
  
  <p>My service interface</p>
  
  <pre><code>@Path("/MyService")
  @Service
  public interface MyService {
  
      @GET
      @Path("/goTest")
      @Produces(MediaType.APPLICATION_JSON)
      public Response testService();
  }
  </code></pre>
  
  <p>Service implementation:</p>
  
  <pre><code>public class MyServiceImpl implements MyService {
  
  public Response testService() {
          // Code
  
          return Response.status(200).entity(gson.toJson(json)).build();
      }
  }
  </code></pre>
  
  <p>Configuration class:</p>
  
  <pre><code> @Configuration
   public class WebServiceSpringConfig {
  
      @Bean(name=Bus.DEFAULT_BUS_ID)
          public SpringBus springBus() {
              return new SpringBus();
          }
  
  
          @Bean
          public Server MyService() {
  
              JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean();
              endpoint.setBus(springBus());
              endpoint.setAddress("/MyService");
              endpoint.setServiceBean(new MyServiceImpl());
              return endpoint.create();
          }
      }
  </code></pre>
  
  <p>Spring config and CXF servlet are declared in the web.xml</p>
  
  <p>I'm using Spring 4.2.0 with CXF 3.1.4</p>