2014-01-21 70 views
0

當我開始在單機模式下的駱駝,我得到我的路線是從我已成立了端點使用消息:駱駝:ROUTE1開始,從消費:端點[...],但它沒有消耗

Route: route1 started and consuming from: Endpoint[http://localhost:9090/hrm/hrm_push?bindingStyle=SimpleConsumer] 

太棒了!

但是,當我切&過去什麼在[]之間到我的瀏覽器我得到一個404 當然,如果駱駝說,這是消耗在這個地址我應該能夠使用該地址聯繫我的REST Web服務。

這裏是我的appContext

<bean id="transformer" class="com.xxxx.portlistener.services.Transformer"> 
</bean> 

<cxf:rsServer id="pushServer" 
       address="http://localhost:9090/hrm/hrm_push?bindingStyle=SimpleConsumer" > 
    <cxf:serviceBeans> 
     <ref bean="transformer" /> 
    </cxf:serviceBeans> 
</cxf:rsServer>   

<cxf:rsServer id="pingServer" 
       address="http://localhost:9090/hrm/hrm_ping" > 
    <cxf:serviceBeans> 
     <ref bean="transformer" /> 
    </cxf:serviceBeans> 
</cxf:rsServer> 

<!-- Camel Configuration --> 
<camel:camelContext id="camel-1" xmlns="http://camel.apache.org/schema/spring"> 
    <package>com.xxxx.portlistener.services</package> 
    <camel:route id="route1"> 
      <camel:from uri="cxfrs://bean://pushServer"/> 
      <camel:to uri="log:TEST?showAll=true" /> 
    </camel:route> 
    <camel:route id="route2"> 
      <camel:from uri="cxfrs://bean://pingServer"/> 
      <camel:to uri="log:TEST?showAll=true" /> 
    </camel:route>    
</camel:camelContext> 

我的服務接口:

@Path("/hrm/") 
public interface PushService 
{ 
/** 
* trasform will change the given Object.... 
*/ 
@POST 
@Produces("text/plain") 
@Path("/hrm_push/") 
public Response pusher(Object pushee); 

@GET 
@Produces("text/plain") 
@Path("/hrm_ping/") 
public Response ping(); 
} 

從控制檯的錯誤:

Jan 21, 2014 10:45:50 AM org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor processRequest 
WARNING: No root resource matching request path/has been found. 
Jan 21, 2014 10:45:51 AM org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper toResponse 
WARNING: WebApplicationException has been caught : no cause is available 

任何人能發現我在做什麼錯?

感謝,

安德魯

回答

1

您已在CXF RS豆,並在Java註釋重複的路徑設置。這兩個將被合併,因此最終的URL將是類似http://localhost:9090/hrm/hrm_push + "/hrm/" + "/hrm_push/"這可能不是你想要的。

建議使用CXF RS bean來定義基本URL,然後使用Java註釋處理所有其他事情。

+0

這樣做的伎倆!謝謝!謝謝! – KingAndrew

相關問題