2015-01-27 2 views
0

CXF 끝점을 정의하려고 시도하지만 작동하지 않습니다. 끝점을 처리하려면 "찾을 수없는"예외가 있습니다.CXF 끝점 정의 및 끝점 확인 실패 : 레지스트리에서 Bean을 찾을 수 없습니다.

CXF 정의 :

@Override 
    public void configure() throws Exception 
    { 

     errorHandler(deadLetterChannel(systemInfo.getQueuName()) 
       .allowRedeliveryWhileStopping(true) 
       .maximumRedeliveries(-1) 
       ); 

     onException(Exception.class).process(routeHandlingBean); 


     CamelContext camelContext = getContext(); 

     CxfEndpoint partnerTestService = new CxfEndpoint(); 
     partnerTestService.setEndpointNameString("partnerTestService"); 
     partnerTestService.setAddress("http://localhost:9081/MockPartnerService"); 
     partnerTestService.setWsdlURL("http://localhost:9081/MockPartnerService?wsdl"); 
     partnerTestService.setServiceClass(aaa.bbb.ccc.service.PartnerService.class); 
     partnerTestService.setServiceNameString("partnerTestService"); 
     partnerTestService.setDataFormat(DataFormat.CXF_MESSAGE); 
     partnerTestService.setCamelContext(camelContext); 

     try { 
      camelContext.addEndpoint("partnerTestService", partnerTestService); 
     } catch (Exception e) { 
      e.printStackTrace(); 
     } 

I 엔드 포인트를 호출하려고 :

cxf:bean:partnerTestService 
다음

나는이 오류 메시지가 가지고있다 :

org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:partnerTestService due to: No bean could be found in the registry for: partnerTestService of type: org.apache.camel.component.cxf.CxfEndpoint 

내가 무엇을 모르겠어요 그렇지 않으면 내가 세워야 해.

Thx! Feri

+0

아파치 CXF 종속성을 포함 시켰습니까? – Namphibian

+0

예, 했어요. 프로젝트에는 CXF 유형 엔드 포인트를 사용하는 경로가있는 다른 경로가 있습니다. – Feri

답변

0

해결 방법은 CxfEndpoint 클래스의 사용법입니다. 필자는 문자열 끝점 대신 필요한 객체를 돌려주는 함수를 작성 했으므로 작동합니다.

경로 정의 :

ValueBuilder dynRouterMethod = method(esbDynRouter, "endpointRoute"); 

    from(queueName).id(systemInfo.getRouteId()).routeId(systemInfo.getRouteId()).autoStartup(false) 
    .transacted() 
    .log(LoggingLevel.INFO, systemInfo.getRouteId() + " route usage.") 
    .beanRef("statusUpdaterBean", "updateSendingStatus") 
    .dynamicRouter(dynRouterMethod) 
    .beanRef("statusUpdaterBean", "updateSentStatus") 
    ; 

절차 (그것은 동적 라우터 절차 호출)

private CxfEndpoint getCxfEndpoint(DispConfView target) throws Exception 
    { 
     CxfEndpoint cxfEndpoint = (CxfEndpoint) camelContext.getEndpoint(<Something>); 

     if (cxfEndpoint == null) 
     { 
      String serviceClassNme = <class name what represent the POJO class>; 
      String methodName = <WS methode name>; 

      cxfEndpoint = new CxfEndpoint(); 
      cxfEndpoint.setAddress(methodName); 
      cxfEndpoint.setDataFormat(DataFormat.POJO); 
      cxfEndpoint.setServiceClass(serviceClassNme); 

      cxfEndpoint.setCamelContext(camelContext); 

      camelContext.addEndpoint(<Something>, cxfEndpoint); 
     } 

     return cxfEndpoint; 
    } 

메시지 POJO 형인 경우이 작업 용액.

관련 문제