2011-04-07 4 views
0

FUSE (Ver 4.3.0) ESB/OSGi 컨테이너에서 낙타 (Ver.2.0.0) 경로를 설정하려고합니다. WebService 호출을 '프록시'주소에서 실제 서비스로 라우팅하려면 간단한 cxf-proxy 여야합니다.FUSE (servicemix)의 낙타 cxf 경로에서 IllegalStateException ESB

나는 몇 가지 문서를 읽어

을 다음과 같은 봄 구성 설정 :

<?xml version="1.0" encoding="UTF-8"?> 
<beans 
    xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:camel="http://camel.apache.org/schema/spring" 
    xmlns:osgi="http://www.springframework.org/schema/osgi" 
    xmlns:cxf="http://camel.apache.org/schema/cxf" 
    xsi:schemaLocation=" 
     http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
     http://www.springframework.org/schema/osgi 
     http://www.springframework.org/schema/osgi/spring-osgi.xsd 
     http://camel.apache.org/schema/osgi 
     http://camel.apache.org/schema/osgi/camel-osgi.xsd 
     http://camel.apache.org/schema/spring 
     http://camel.apache.org/schema/spring/camel-spring.xsd 
     http://camel.apache.org/schema/cxf 
     http://camel.apache.org/schema/cxf/camel-cxf.xsd"> 

    <import 
     resource="classpath:META-INF/cxf/cxf.xml" /> 
    <import 
     resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> 
    <import 
     resource="classpath:META-INF/cxf/cxf-extension-http.xml" /> 
    <import 
     resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" /> 

    <!-- the proxy service --> 
    <cxf:cxfEndpoint 
     id="myServiceProxy" 
     address="http://localhost:9003/cxf/myService" 
     serviceClass="foo.bar.iface.MyServiceInterface" /> 

    <!-- my real existing cxf soap service --> 
    <cxf:cxfEndpoint 
     id="myService" 
     address="http://foo.bar/services/myService" 
     wsdlURL="http://foo.bar/services/myService?wsdl" 
     serviceClass="foo.bar.iface.MyServiceInterface" 
     serviceName="s:MyService" 
     endpointName="s:MyServiceEndpoint" 
     xmlns:s="http://foo.bar/iface/" /> 

    <!-- route --> 
    <camel:camelContext> 
     <camel:route> 
      <camel:from 
       uri="cxf:bean:myServiceProxy" /> 
      <camel:to 
       uri="cxf:bean:myService" /> 
     </camel:route> 
    </camel:camelContext> 

</beans> 

FUSE가 인도에 번들을 시작하려을 이 예외

[email protected]> Exception in thread "SpringOsgiExtenderThread-22" org.apache.camel.RuntimeCamelException: java.lang.IllegalStateException: Endpoint address should be a relative URI wrt to the servlet address (use '/xxx' for example) 
     at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1126) 
     at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103) 
     at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:231) 
     at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97) 

무엇이 잘못 되었나요? 내 종점 주소가 잘못되어 서블릿 주소가 무엇인지 알지 못합니다 (cxf : cxfEndoint servelt 주소 속성이 없음).

이 문제를 해결하기 위해 올바른 방향으로 나를 인도 할 수있는 도움을 주시면 감사하겠습니다.

감사 클라우스

답변

1

나는 마지막으로 무엇이 잘못되었는지 알게되었습니다.

대신

<!-- the proxy service --> 
<cxf:cxfEndpoint 
    id="myServiceProxy" 
    address="http://localhost:9003/cxf/myService" 
    serviceClass="foo.bar.iface.MyServiceInterface" /> 

는 첫 번째 방법은 물론이 경우에는 HTTP 서버가 서비스를 제공하기 위해 시작됩니다 (FUSE 외부 낙타 프로젝트를 실행했다으로

<!-- the proxy service --> 
<cxf:cxfEndpoint 
    id="myServiceProxy" 
    address="/myService" 
    serviceClass="foo.bar.iface.MyServiceInterface" /> 

수있다) FUSE 내부의 상대 주소 여야합니다.

내부에서 실행되는 임베디드 HTTP 서버 (localhost : 8181)가 사용되며 서비스 URL은 http://localhost:8181/cxf/myService으로 확장됩니다.