【问题标题】:Deploy camel project in fuse fabric在 fuse Fabric 中部署骆驼项目
【发布时间】:2017-10-16 22:41:14
【问题描述】:

在 fuse Fabric 环境中部署骆驼项目时,我想了解以下内容。 我已经创建了捆绑罐。这些捆绑 jar 在非结构环境中运行良好。即当我将这些 jar 移动到 jboss-fuse 上的部署目录时,它工作得很好。 当相同的罐子移动到子容器时,它不起作用。我为织物环境设置的内容如下:

创建的 Fabric 容器:

fabric:create --new-user fadmin --new-user-password maskerkey --generate-zookeeper-password --resolver localip

子容器:

fabric:container-create-child root node 2

我应该如何将相同的捆绑包部署到子容器?我在部署捆绑 jar 时看到以下异常:

org.osgi.framework.BundleException: Unresolved constraint in bundle BUNDLE_NAME [139]: Unable to resolve 139.0: missing requirement [139.0] osgi.wiring.package; (osgi.wiring.package=org.apache.activemq.camel.component)

【问题讨论】:

    标签: java jbossfuse fuseesb


    【解决方案1】:

    当你有fabric 环境时,你不应该使用deploy/ 目录。而是用于原型设计。

    当您使用以下方式创建子容器时:

    fabric:container-create-child root node 2
    

    您现在有两个名为 node1node2 的容器

    OSGi 中的bundle 只是一个增强的 JAR。

    A (Karaf) featurebundles(可能还有配置)的集合,因此您可以更轻松地安装多个 bundles。

    (Fabric)profile 是捆绑包、功能、配置和资源的声明(大致),因此您可以更轻松地安装多个 (karaf) 功能。

    您的错误消息意味着尚未安装可以满足 您的 捆绑包要求的捆绑包。更准确地说,你缺少一个导出 org.apache.activemq.camel.component 包的包。

    如果您查看 Fuse 提供的配置文件和功能,您会看到:

    JBossFuse:karaf@root> features:info activemq-camel
    Description of activemq-camel 5.11.0.redhat-vvv feature
    ----------------------------------------------------------------
    Feature has no configuration
    Feature has no configuration files
    Feature depends on:
      activemq-client 5.11.0.redhat-vvv
      camel-spring [2.17,3)
      camel-jms [2.17,3)
      camel [2.17,3)
    Feature contains followed bundles:
     mvn:org.apache.activemq/activemq-camel/5.11.0.redhat-vvv start-level=50
    Feature has no conditionals.
    

    (其中vvv 是 Fuse 的构建)。

    现在你必须创建你的个人资料

    profile-create myprofile
    

    为其添加activemq-camel 功能:

    profile-edit --feature activemq-camel myprofile
    

    将您的捆绑包添加到其中:

    profile-edit --bundle mvn:your-groupId/your-artifactId/your-version
    

    并将此配置文件分配给一个容器(容器)

    container-add-profile node1 myprofile
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-14
      • 2019-03-10
      • 2015-12-12
      • 1970-01-01
      相关资源
      最近更新 更多