java - 如何在KURA框架中配置apache CAMEL

标签 java eclipse apache-camel osgi rhiot

我正在 Apache Camel 中工作,它必须包含在 KURA 框架中以进行节流和其他一些目的,所以我遵循了 this link 。 我已经提供了 KuraRouter(来自 jar 文件)作为 KURA 项目中的主类,而不是 HelloOsgi 和 component.xml 文件中,该类中的启动和停止函数作为激活和停用方法。但是当我运行它时,它显示以下错误!留言内容

Exception occurred while creating new instance of component Component[
    name = org.apache.camel.component.kura.KuraRouter
    activate = start
    deactivate = stop
    modified = 
    configuration-policy = optional
    factory = null
    autoenable = true
    immediate = true
    implementation = org.apache.camel.component.kura.KuraRouter
    state = Unsatisfied
    properties = 
    serviceFactory = false
    serviceInterface = null
    references = null
    located in bundle = org.eclipse.kura.example.hello_osgi_1.0.0.qualifier [20]
] 
!STACK 0
java.lang.ClassNotFoundException: org.apache.camel.component.kura.KuraRouter

我在 Kura 中的 Camel 配置是否错误,是否有任何好的步骤。

Manifest.MF 文件是

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Hello world Example With Logger
Bundle-SymbolicName: org.eclipse.kura.example.hello_osgi
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: .,/junit.jar,
 camel-core-2.15.2.jar,
 camel-core-osgi-2.15.2.jar,
 org.osgi.core-4.3.0.jar,
 slf4j-api-1.6.1.jar,
 camel-kura-2.15.2.jar,
 commons-management-1.0.jar,
 apache-activemq-4.1.1.jar
Import-Package: org.eclipse.kura.core.configuration;version="0.2.0",
 org.json,
 org.osgi.service.component;version="1.2.0",
 org.slf4j;version="1.6.4",
 org.osgi.framework;version="1.3.0"
Service-Component: component.xml

而 component.xml 文件是

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" enabled="true" immediate="true" name="org.apache.camel.component.kura.KuraRouter">

 <implementation class="org.apache.camel.component.kura.KuraRouter"/>

</scr:component>

最佳答案

启动 Kura Camel 项目的最佳方法是使用此 [1] 快速入门。更多详细信息请参见此处 [2]。

如果有任何问题,请随时联系我。 :)

[1] https://github.com/rhiot/quickstarts/tree/master/kura-camel [2]https://rhiot.gitbooks.io/rhiotdocumentation/content/quickstarts/kura_camel_quickstart.html

关于java - 如何在KURA框架中配置apache CAMEL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30660111/

相关文章:

spring-boot - Autowiring 的 FluentProducerTemplate 在同一服务中使用之前是否需要清除其 header 和正文?

java - 分析 Java 中的线程行为

java - Apache Camel : Control over route startup

java - 返回数组类

Eclipse Neon 不启动

java - 使用 Eclipse/MyEclipse 刷新 Swing 应用程序

css - JavaFX 从资源文件夹加载 CSS 样式

java - 如何使用 Camel 将 Rest 请求从本地服务路由到远程服务

java - 匿名对象有什么优点?

java - 如何在Java 1.6中将UTC日期转换为本地日期