首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Servicemix简单捆绑包缺少要求

Servicemix简单捆绑包缺少要求
EN

Stack Overflow用户
提问于 2019-06-18 17:14:54
回答 2查看 616关注 0票数 0

你好,我是servicemix的新手,不能启动一个简单的自编程捆绑包。

我的pom.xml:

代码语言:javascript
代码运行次数:0
运行
复制
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<!-- Generated by Apache ServiceMix Archetype -->

<modelVersion>4.0.0</modelVersion>

<groupId>de.rupp</groupId>
<artifactId>test</artifactId>
<packaging>bundle</packaging>
<version>1.0-SNAPSHOT</version>
<name>test</name>

<properties>
   <camel.version>3.0.0-M3</camel.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-core</artifactId>
        <version>${camel.version}</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <defaultGoal>install</defaultGoal>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.0.2</version>
            <configuration>
                <source>1.5</source>
                <target>1.5</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.4.3</version>
            <configuration>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.3.6</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                    <Import-Package>*</Import-Package>
                    <Private-Package>de.rupp</Private-Package>
                </instructions>
            </configuration>
        </plugin>
    </plugins>
</build>

我的camel-context.xml

代码语言:javascript
代码运行次数:0
运行
复制
<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"
  xsi:schemaLocation="
  http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  http://camel.apache.org/schema/spring
  http://camel.apache.org/schema/spring/camel-spring-2.10.3.xsd">
<camelContext id="Merda" xmlns="http://camel.apache.org/schema/spring">
    <packageScan>
         <package>de.rupp</package>
     </packageScan>
 </camelContext>
 </beans>

我只有一个简单的类

代码语言:javascript
代码运行次数:0
运行
复制
public class TestRoute extends RouteBuilder {

@Override
public void configure() throws Exception {
    from("file:in")
        .id("file-in")
        .log("Nachricht: ${body}")
        .to("file:out");

}

}

生成的MANIFEST.MF为

代码语言:javascript
代码运行次数:0
运行
复制
Manifest-Version: 1.0
Bnd-LastModified: 1560848195732
Build-Jdk: 1.8.0_181
Built-By: bla
Bundle-ManifestVersion: 2
Bundle-Name: test
Bundle-SymbolicName: test
Bundle-Version: 1.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Export-Package: de.rupp;uses:="org.apache.camel.builder,org.apache.camel
 .model";version="1.0.0.SNAPSHOT"
Import-Package: org.apache.camel.builder;version="[3.0,4)",org.apache.ca
 mel.model;version="[3.0,4)"
Tool: Bnd-1.50.0

当我将jar复制到deploy文件夹并使用bundle:list时,我看到它已安装225 | installed | 80 | 1.0.0.SNAPSHOT | test

但是我不能启动它。

karaf@root>start 225

代码语言:javascript
代码运行次数:0
运行
复制
Error executing command: Error executing command on bundles:
        Error starting bundle 225: Unable to resolve test [225](R 225.14): missi
ng requirement [test [225](R 225.14)] osgi.wiring.package; (&(osgi.wiring.packag
e=org.apache.camel.builder)(version>=3.0.0)(!(version>=4.0.0))) Unresolved requi
rements: [[test [225](R 225.14)] osgi.wiring.package; (&(osgi.wiring.package=org
.apache.camel.builder)(version>=3.0.0)(!(version>=4.0.0)))]

任何帮助都将不胜感激。有没有人知道写驼峰包的好教程?

谢谢,

汉斯

EN

回答 2

Stack Overflow用户

发布于 2019-06-18 18:46:26

您应该使用ServiceMix正在使用的Camel版本(随附的开箱即用)。ServiceMix不支持驼峰3。

另外,我想知道是否应该考虑只使用Apache Karaf或Camel的替代运行时(Spring Boot,Quarkus,Tomcat,通过Camel Main的独立Camel ),因为ServiceMix不再那么活跃了。

票数 1
EN

Stack Overflow用户

发布于 2020-02-21 14:24:47

使用以下内容替换您的属性:

代码语言:javascript
代码运行次数:0
运行
复制
<properties>
   <camel.version>2.16.5</camel.version>
</properties>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56645662

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档