title: Apache Camel - Spring rest endpoint reference
body: <p>I have an application using camel rest component. Originally, I use camel version v2.17.0 and every rest endpoint returns http return code 200 when call.</p>
  
  <p>One day when I update my application's camel version to v2.18.0 (without any other change), all rest endpoint returns http return code 404 when call. The same case happens for v2.18.4 and v2.19.0. </p>
  
  <p>I doubt whether there is a change in rest endpoint path reference via Spring. Is anyone know how to correct my setup? The workaround I am using is to move hardcode String back to Spring which does not fit my intention.</p>
  
  <p><strong>Spring setup for Rest Service</strong></p>
  
  <pre><code>&lt;endpoint id="httpAppRouteBuildRemainPath" uri="#{commonUtilService.getEpUtil().getHTTPAppJsonBuildRemainPath()}" /&gt;
  &lt;endpoint id="httpSysRouteBuildRemainPath" uri="#{commonUtilService.getEpUtil().getHTTPSysJsonBuildRemainPath()}" /&gt;
  &lt;endpoint id="httpJsonBuildManagementRouteEndPoint" uri="#{commonUtilService.getEpUtil().getHTTPJsonBuildManagementRouteEndpointPath()}" /&gt;
  
  &lt;rest path="#commonUtilService.getEpUtil().getHTTPJsonManagementRestPath()"&gt;
          &lt;put uri="ref:httpAppRouteBuildRemainPath" id="appHttpRouteReceiver"&gt;
                  &lt;to uri="ref:httpJsonBuildManagementRouteEndPoint"/&gt;
          &lt;/put&gt;
          &lt;put uri="ref:httpSysRouteBuildRemainPath" id="sysHttpRouteReceiver"&gt;
                  &lt;to uri="ref:httpJsonBuildManagementRouteEndPoint"/&gt;
          &lt;/put&gt;
  &lt;/rest&gt;
  </code></pre>
  
  <p><strong>Java Setup</strong></p>
  
  <pre><code>public String getHTTPJsonManagementRestPath() {
          return "/worker/json";
  }
  
  public String getHTTPAppJsonBuildRemainPath() {
          return "/app/build";
  }
  
  public String getHTTPSysJsonBuildRemainPath() {
          return "/sys/build";
  } 
  </code></pre>
  
  <p><strong>Test Result</strong></p>
  
  <p>Under camel version v2.17.0</p>
  
  <blockquote>
    <p>Jun 07, 2017 11:10:16 AM org.restlet.engine.log.LogFilter afterHandle</p>
    
    <p>INFO: 2017-06-07 11:10:16 0:0:0:0:0:0:0:1 - - 9395 PUT
    /worker/json/app/build - <strong>200</strong> 40 124 35 <a href="http://localhost:9395" rel="nofollow noreferrer">http://localhost:9395</a>        - -</p>
  </blockquote>
  
  <p>Under camel version v2.18.0</p>
  
  <blockquote>
    <p>Jun 07, 2017 11:11:33 AM org.restlet.routing.Template getRegexPattern</p>
    
    <p>WARNING: Empty pattern variables are not allowed : null
    Jun 07, 2017 11:11:33 AM org.restlet.routing.Template getRegexPattern</p>
    
    <p>WARNING: Empty pattern variables are not allowed : null
    Jun 07, 2017 11:11:33 AM org.restlet.routing.Template getRegexPattern</p>
    
    <p>WARNING: Empty pattern variables are not allowed : null
    Jun 07, 2017 11:11:33 AM org.restlet.routing.Template getRegexPattern</p>
    
    <p>WARNING: Empty pattern variables are not allowed : null
    Jun 07, 2017 11:11:33 AM org.restlet.engine.log.LogFilter afterHandle</p>
    
    <p>INFO: 2017-06-07 11:11:33 0:0:0:0:0:0:0:1 - - 9395 PUT /worker/json/app/build - <strong>404</strong> 439 124 12 <a href="http://localhost:9395" rel="nofollow noreferrer">http://localhost:9395</a>        - - </p>
  </blockquote>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>I change the spring setup to</p>
  
  <pre><code>&lt;rest path="/worker/json"&gt;
      &lt;put uri="/app/build" id="appHttpRouteReceiver"&gt;
          &lt;to uri="ref:httpJsonBuildManagementRouteEndPoint"/&gt;
      &lt;/put&gt;
      &lt;put uri="ref:httpSysRouteBuildRemainPath" id="sysHttpRouteReceiver"&gt;
          &lt;to uri="ref:httpJsonBuildManagementRouteEndPoint"/&gt;
      &lt;/put&gt;
  &lt;/rest&gt;
  </code></pre>
  
  <p><strong>Test result</strong></p>
  
  <p>Under camel version v2.18.0</p>
  
  <blockquote>
    <p>Jun 26, 2017 10:12:50 AM org.restlet.engine.log.LogFilter afterHandle</p>
    
    <p>INFO: 2017-06-26   10:12:50    0:0:0:0:0:0:0:1 -   -   9395    PUT /worker/json/<strong>ref:httpSysRouteBuildRemainPath</strong>    -   <strong>200</strong> 61  46  39  <a href="http://localhost:9395" rel="nofollow noreferrer">http://localhost:9395</a>   -   -</p>
    
    <p>Jun 26, 2017 10:14:54 AM org.restlet.engine.log.LogFilter afterHandle</p>
    
    <p>INFO: 2017-06-26   10:14:54    0:0:0:0:0:0:0:1 -   -   9395    PUT /worker/json/<strong>app/build</strong>  -   <strong>200</strong> 61  40  18  <a href="http://localhost:9395" rel="nofollow noreferrer">http://localhost:9395</a>   Jakarta Commons-HttpClient/3.1  -</p>
    
    <p>Jun 26, 2017 10:18:53 AM org.restlet.engine.log.LogFilter afterHandle</p>
    
    <p>INFO: 2017-06-26   10:18:53    0:0:0:0:0:0:0:1 -   -   9395    PUT /worker/json/<strong>sys/build</strong>  -   <strong>404</strong> 439 40  6   <a href="http://localhost:9395" rel="nofollow noreferrer">http://localhost:9395</a>   Jakarta Commons-HttpClient/3.1  -</p>
  </blockquote>