2014-10-03 69 views
0

我有一个fabric-camel组件的问题。Fabric-karaf,Apache Camel,fabric-camel:“组件未启动”

它可以检测我的骆驼端点从蓝图:

2014-10-02 15:27:43,598 | INFO | 26c-351-thread-2 | FabricPublisherEndpoint   | 204 - io.fabric8.fabric-camel - 1.1.0.CR5 | Child: jetty:https://127.0.0.1:1221/https/incontrol?matchOnUriPrefix=true 
2014-10-02 15:27:43,598 | INFO | 26c-351-thread-2 | FabricPublisherEndpoint   | 204 - io.fabric8.fabric-camel - 1.1.0.CR5 | Consumer: jetty:https://127.0.0.1:1221/https/incontrol?matchOnUriPrefix=true 

但后来我得到 “产生的原因:java.lang.IllegalStateException:组件未启动”

2014-10-02 15:27:43,602 | ERROR | 26c-351-thread-2 | BlueprintContainerImpl   | 197 - org.apache.aries.blueprint.core - 1.4.0 | Unable to start blueprint container for bundle pl.com.xxxxxx.esb.esb-incontrol-proxy 
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean .camelBlueprint.factory.inControlProxyContext 
...  
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: fabric://incontrol:jetty:https://127.0.0.1:1221/https/incontrol?matchOnUriPrefix=true due to: Component is not started 
... 
Caused by: java.lang.IllegalStateException: Component is not started 
    at io.fabric8.camel.ZKComponentSupport.createGroup(ZKComponentSupport.java:53) 

更详细的堆栈跟踪http://pastebin.com/BFrPBarp

我的blueprint.xml(相关部分):

<!-- Boundary beans --> 
<bean id="httpsRouteBuilder" class="pl.com.xxxxxxx.camel.builder.HttpsRouteBuilder"> 
    ... 

    <property name="incomingUri" value="fabric:incontrol:jetty:${endpoint.https.incoming.url}?matchOnUriPrefix=true"/> 
    <property name="outgoingUri" value="${endpoint.https.outgoing.url}?bridgeEndpoint=true&amp;throwExceptionOnFailure=false"/> 

    ... 
</bean> 
... 
<camelContext id="inControlProxyContext" trace="false" streamCache="true" 
       xmlns="http://camel.apache.org/schema/blueprint" 
       xsi:schemaLocation="http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint-2.10.0.xsd"> 
    ... 
    <routeBuilder ref="httpsRouteBuilder"/> 
    ... 
</camelContext> 

我的pom.xml(相关部分):

<!-- Fabric --> 
<dependency> 
    <groupId>io.fabric8</groupId> 
    <artifactId>fabric-camel</artifactId> 
    <scope>provided</scope> 
</dependency> 

我会尝试启用调试日志记录,并看看还有什么我能找到。不幸的是,我仍然不明白底层的问题:为什么组件没有启动?

版本信息:

  • Karaf:2.3.0.redhat-610379
  • 面料:1.1.0.CR5

回答

0

您可以尝试执行手动实例化的组件和在路线启动之前开始:尝试如下所示:

<endpoint xmlns="http://camel.apache.org/schema/blueprint" id="fakeFabricEndpoint" uri="fabric:fake:jetty:${endpoint.https.incoming.url}?matchOnUriPrefix=true"/>