ResteasyHandlerMapping Resource Not Found for Swagger base url
<p>I was trying to integrate swagger with my project for api documentation. 
But restEasy is unable to map to my swagger base url inspite of config being provided.</p>

<p>I am not sure if i am missing some part of it or not. I have been doing research regarding this from few days now and mostly i am following their documentation <a href="https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup#using-springs-bean-declaration" rel="nofollow noreferrer">Swagger Integration documentation</a>.</p>

<p>My web.xml</p>

<pre><code>&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;listener&gt;
    &lt;listener-class&gt;org.jboss.resteasy.plugins.spring.SpringContextLoaderListener&lt;/listener-class&gt;
&lt;/listener&gt;

&lt;servlet&gt;
    &lt;servlet-name&gt;spring&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/spring/spring-servlet.xml&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
</code></pre>

<p>My spring-servlet.xml </p>

<pre><code>&lt;annotation-driven /&gt;
&lt;beans:import resource="classpath:springmvc-resteasy.xml" /&gt;

&lt;beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
    &lt;beans:property name="prefix" value="/views/" /&gt;
    &lt;beans:property name="suffix" value=".jsp" /&gt;
&lt;/beans:bean&gt;

&lt;context:component-scan base-package="com.sample.web.controller" /&gt;
&lt;context:component-scan base-package="com.*.web"&gt;
    &lt;context:include-filter type="annotation" expression="javax.ws.rs.ext.Provider" /&gt;
&lt;/context:component-scan&gt;
</code></pre>

<p>My applicationContext.xml</p>

<pre><code>&lt;context:component-scan base-package="com.sample" /&gt;

&lt;bean class="com.wordnik.swagger.jaxrs.listing.ApiListingResourceJSON" /&gt;
&lt;bean class="com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider" /&gt;
&lt;bean class="com.wordnik.swagger.jaxrs.listing.ResourceListingProvider" /&gt;

&lt;bean id="beanConfig" class="com.wordnik.swagger.jaxrs.config.BeanConfig"&gt;
    &lt;property name="title" value="Swagger Sample App"/&gt;
    &lt;property name="version" value="1.0.0" /&gt;
    &lt;property name="basePath" value="http://localhost:8100/rest"/&gt;
    &lt;property name="resourcePackage" value="com.sample.web.controller"/&gt;
    &lt;property name="scan" value="true"/&gt;
&lt;/bean&gt;
</code></pre>

<p>On running this project and then checking this url "localhost:8100/rest/api-docs/" i receive following stack trace </p>

<pre><code>ERROR ResteasyHandlerMapping Resource Not Found: Could not find resource for relative : /rest/api-docs of full path: http://localhost:8100/rest/api-docs/ org.jboss.resteasy.spi.NotFoundException: Could no
</code></pre>

<p>t find resource for relative : /rest/api-docs of full path: localhost:8100/rest/api-docs/
        at org.jboss.resteasy.core.registry.RootSegment.matchChildren(RootSegment.java:360)
        at org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:374)
        at org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:367)
        at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:297)
        at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:173)
        at org.jboss.resteasy.springmvc.ResteasyHandlerMapping.getInvoker(ResteasyHandlerMapping.java:99)
        at org.jboss.resteasy.springmvc.ResteasyHandlerMapping.getHandler(ResteasyHandlerMapping.java:76)
        at org.springframework.web.servlet.DispatcherServlet.getHandler(DispatcherServlet.java:1104)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:916)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
        at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:673)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)</p>