0

我们apache-karaf-4.2.0在未连接到 Internet 的内部网络上运行。我们正在尝试让一个 HTTP 服务器在 Karaf 中运行,我们决定使用它,org.apache.felix.http.bundle-3.0.0.jar因为它在一个 jar 中包含了我们需要的所有内容(而不是带回httpKaraf 中功能中列出的所有内容)。

这是我重现该问题的步骤:

  1. 下载副本apache-karaf-4.2.0.tar.gz并解压
  2. 下载一份org.apache.felix.http.bundle-3.0.0.jar
  3. 光盘进入apache-karaf-4.2.0
  4. mkdir -p system/org/apache/felix/org.apache.felix.http.bundle/3.0.0/
  5. 复制org.apache.felix.http.bundle-3.0.0.jar到刚刚创建的目录
  6. 打开 system/org/apache/karaf/features/standard/4.2.0/standard-4.2.0-features.xml
  7. 在底部,在<feature name="standard"...>添加以下行之前(请参阅下文,因为我无法将其嵌入到此列表中):
  8. 打开etc/custom.properties
  9. 将以下行添加到底部:org.apache.felix.jettyEnabled = true
  10. 执行./bin/karaf
  11. 在 karaf 提示符下键入:feature:install felix-http

下面是 XML 在文件中的样子standard-4.2.0-features.xml

<feature name="felix-http" description="Apache Felix HTTP Bundle" version="4.2.0">
    <bundle>mvn:org.apache.felix/org.apache.felix.http.bundle/3.0.0</bundle>
    <config name="org.apache.felix.http">
        org.osgi.service.http.port=8888
    </config>
</feature>

如果我理解IncompatibleClassChangeError这意味着某些东西是用其他东西的旧版本编译的。我假设其他东西jetty但没有其他东西提供它。所以我很困惑。

如果有人对如何继续调试和/或修复此问题有任何想法,我将不胜感激。

4

0 回答 0