Spring-WS 1.5 可以与 Spring 3 一起使用吗?

发布于 2024-09-11 04:55:14 字数 126 浏览 4 评论 0原文

Spring-ws 1.5.9依赖于Spring 2.5(基于pom)。它可以与 Spring 3 一起使用而不会遇到任何类加载问题吗?我知道某些包在两者之间匹配,我可以不包含那些 Spring 3 jar 吗?我似乎找不到任何官方说法。

Spring-ws 1.5.9 depends on Spring 2.5 (based on the pom). Can it be used with Spring 3 without running into any classloading issues. I know that some of the packages match between the two, can I just not include those Spring 3 jars? I cant seem to find any official word on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

只是一片海 2024-09-18 04:55:14

除了skaffman的回答之外,以下是如何通过Maven将Spring-WS 1.5.9与Spring 3一起使用:

1)首先排除Spring 3的OXM依赖项。只需从POM中删除以下依赖项即可。

<dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-oxm</artifactId>
</dependency>

如果您使用的另一个框架对 Spring 3 有传递依赖(例如 Apache Camel 的camel-spring 模块),请使用:

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<exclusions>
    <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
    </exclusion>
</exclusions>
</dependency>

2) 删除 Spring-WS 1.5.9 对 Spring 2.5 的传递依赖.6:

<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws-core</artifactId>
    <version>1.5.9</version>
    <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws-support</artifactId>
    <version>1.5.9</version>
    <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </exclusion>
    </exclusions>
</dependency>

3) 最后确保您在 POM 中包含必要的 Spring 3 模块(上面的列表)作为依赖项。

就是这样,您现在应该能够将 Spring-WS 1.5.9 与 Spring 3.x 一起使用。

In addition to skaffman's answer, here's how to use Spring-WS 1.5.9 with Spring 3 through Maven:

1) First exclude the OXM dependency of Spring 3. Just remove the following dependency from your POM.

<dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-oxm</artifactId>
</dependency>

If you're using another framework that has a transitive dependency on Spring 3 (like Apache Camel's camel-spring module) use:

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<exclusions>
    <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
    </exclusion>
</exclusions>
</dependency>

2) Remove the transitive dependency that Spring-WS 1.5.9 has on Spring 2.5.6:

<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws-core</artifactId>
    <version>1.5.9</version>
    <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws-support</artifactId>
    <version>1.5.9</version>
    <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </exclusion>
    </exclusions>
</dependency>

3) Finally make sure you include the necessary Spring 3 modules (the list above) as dependencies in your POM.

That's it you should now be able to use Spring-WS 1.5.9 with Spring 3.x.

梅窗月明清似水 2024-09-18 04:55:14

官方说法是,不,它们不兼容。正如您所说,两者之间存在包冲突 - 特别是 org.springframework.oxm 。这个包是从 Spring-WS 引入到 Spring 3 中的,两者会发生冲突。

Spring-WS 2.0 的工作本应在 Spring 3.0 发布后立即完成,但这并没有发生。在此之前,Spring-WS 仍然与当前版本的 Spring 框架不兼容。

在实践中,我发现如果您省略 Spring 3 发行版中的 org.springframework.oxm JAR,则两者可以很好地协同工作。不过,如果您使用的是 Maven,我不确定这是否适合您。

Officially, no, they're not compatible. Like you said, there are package conflicts between the two - org.springframework.oxm in particular. This package was brought into Spring 3 from Spring-WS, and the two will clash.

Work was supposed to be completed on Spring-WS 2.0 immediately after Spring 3.0 was released, but this hasn't happened. Until that happens, Spring-WS remains incompatible with the current release of Spring Framework.

In practise, I've found that if you omit the org.springframework.oxm JAR from the Spring 3 distro, the two work fine together. If you're using maven, though, I'm not sure if this is an option for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文