簡體   English   中英

如何解決 osgi.wiring.package=javax.jms)(version>=1.1.0)(.(version>=2.0?0) 問題?

[英]How do I solve osgi.wiring.package=javax.jms)(version>=1.1.0)(!(version>=2.0.0) issue?

收到此錯誤。 我已經包含了我的 pom.xml 中的一些代碼。 我已經安裝了 geronimo 1.1 jms 規范,但這根本沒有解決問題。 由於某種原因,我遇到了依賴問題。 我沒有在我的 pom 中使用任何 javax.jms 1.1 依賴項,但 osgi 一直在要求它。 我已經在 redhat 中搜索了我的解決方案,但無濟於事。

4.0.0

<groupId>com.ups.ttg.ao.fuse</groupId>
<artifactId>foi-ao-acars-request</artifactId>
<version>3.3-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>foi-ao-acars-request</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.fuse.bom</groupId>
            <artifactId>jboss-fuse-parent</artifactId>
            <version>6.3.0.redhat-377</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>com.ups.ttg.ao.fuse</groupId>
        <artifactId>foi-ao-common</artifactId>
        <version>3.2.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-ws</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-http</artifactId>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-camel</artifactId>
    </dependency>
    <dependency>
        <groupId>com.ibm.mq</groupId>
        <artifactId>com.ibm.mq.allclient</artifactId>
        <version>9.0.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-test-spring3</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <defaultGoal>install</defaultGoal>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxb2-maven-plugin</artifactId>
            <version>1.5</version>
            <executions>
                <execution>
                    <id>xjc</id>
                    <goals>
                        <goal>xjc</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <schemaDirectory>${basedir}/src/main/resources/xsd</schemaDirectory>
                <schemaIncludes>${basedir}/src/main/resources/xsd/ADLB</schemaIncludes>
                <schemaIncludes>${basedir}/src/main/resources/xsd/TWC</schemaIncludes>
                <!-- <bindingFiles>bindings.xml</bindingFiles> -->
                <extension>true</extension>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.3.7</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                    <Private-Package>com.ups.ttg.ao.fuse.acarsrequest</Private-Package>
                    <Import-Package>*,org.apache.camel.osgi;resolution:=optional, javax.jms; version=[1.1.0,3)</Import-Package>
                </instructions>
                <instructions>
                    <manifestLocation>src/main/resources/META-INF</manifestLocation>
                    <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                    <Import-Package>*,org.apache.log4j</Import-Package>
                </instructions>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-maven-plugin</artifactId>
            <version>2.15.1</version>
            <configuration>
                <!-- the spring context file must be separate from the OSGi bundle, 
                    so we provide one here -->
                <fileApplicationContextUri>src/main/resources/META-INF/spring/camel-context.xml</fileApplicationContextUri>
                <logClasspath>true</logClasspath>
            </configuration>
        </plugin>
    </plugins>
</build>

您列出的錯誤應該包括抱怨的包。 您的 pom.xml 文件中列出的依賴項需要 JMS 2.0.1。 我懷疑它是需要 JMS 1.0 的捆綁包之一。 您可以在 karaf 提示符下使用list命令以及headersimports命令來查看捆綁包要求。

JBoss Fuse 6.3 包括 ActiveMQ 5,它在技術上是 JMS 1.0 實現。 JBoss Fuse 6.3 中包含的 JMS 規范包沒有將 JMS 1.0 列為支持,僅列出了 JMS 2。鑒於 JMS 2 規范明確指出所有 JMS 2 實現必須支持 JMS 1 應用程序而無需修改,我覺得這是一個疏忽。

So, what you have in JBoss Fuse is an ActiveMQ version that only supports JMS 1. The JMS API version that is included in JBoss Fuse lists only JMS 2. This was done to support IBM MQ 8 and greater that require JMS 2. Even though IBM MQ 8 和 9 說他們需要 JMS 2,然而,實際的 IBM 客戶端代碼只使用 JMS 1。

最重要的是,確定哪個包需要 JMS 1,並更改包清單文件以說明包可以使用 JMS 2。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM