【问题标题】:How do I solve osgi.wiring.package=javax.jms)(version>=1.1.0)(!(version>=2.0.0) issue?如何解决 osgi.wiring.package=javax.jms)(version>=1.1.0)(!(version>=2.0.0) 问题?
【发布时间】:2020-07-18 22:16:16
【问题描述】:

Getting this error.我已经包含了我的 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>

【问题讨论】:

    标签: java maven plugins jbossfuse


    【解决方案1】:

    您列出的错误应该包括抱怨的包。 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 应用程序而无需修改,我觉得这是一个疏忽。

    所以,JBoss Fuse 中的 ActiveMQ 版本仅支持 JMS 1。JBoss Fuse 中包含的 JMS API 版本仅列出 JMS 2。这样做是为了支持需要 JMS 2 的 IBM MQ 8 及更高版本. 尽管 IBM MQ 8 和 9 说他们需要 JMS 2,但是实际的 IBM 客户端代码只使用 JMS 1。

    最重要的是,确定哪个包需要 JMS 1,然后更改包清单文件以说明该包可以使用 JMS 2。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-03
      • 1970-01-01
      • 2018-06-21
      • 1970-01-01
      • 2021-06-02
      • 2023-03-26
      • 1970-01-01
      • 2014-04-15
      相关资源
      最近更新 更多