Mule:使用比 mule 服务器捆绑库中捆绑的更高版本的 spring 和 hibernate

标签 mule mule-studio mule-component

我正在使用 Mule 3.5.2,并在 mule studio 中创建一个 Mule 项目,其中包含一个 Mule Server 3.5.2 EE 库,该库已经具有 spring 和 hibernate 特定版本(spring --->3.2.10,hibernate -->3.6)。 0)。

是否可以使用比 mule 服务器库中已捆绑的更高版本的 spring 和 hibernate?

最佳答案

我不知道是否可以用较新的版本覆盖 spring,但我设法在我的一个应用程序中使用较新版本的 DBUtils(而不是捆绑在 mule 中的旧版本)。

尝试在 pom.xml 中排除 mule jar 中的所有 spring 依赖项。在新的 3.5.2 项目中,类似于:

<!-- Mule Dependencies -->
    <dependencies>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb</groupId>
            <artifactId>mule-core-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb.modules</groupId>
            <artifactId>mule-module-spring-config-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Mule Transports -->
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-file</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-http</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jdbc-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jms-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-vm</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Modules -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-scripting</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-xml</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- for testing -->
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-functional</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.cloveretl</groupId>
            <artifactId>cloveretl-engine</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

并插入您要使用的 spring 版本的依赖项。将以下条目插入到 mule-deploy.properties 中,以强制类加载器首先从应用程序中搜索类:

loader.override=org.springframework

这没有经过测试。希望这可以帮助您。

关于Mule:使用比 mule 服务器捆绑库中捆绑的更高版本的 spring 和 hibernate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29072866/

相关文章:

exception - 为什么 Mule 回滚异常会传播到调用它的流?

mule - mule 4中JSON数据的转换

soap - mule esb web 服务使用者 SOAP - 错误 : Prefix not specified

eclipse - m2e - 将 Maven 插件添加到 Mule Studio 时缺少通过 logback 日志记录(可选)的 slf4j

java - Mule 3.5.0 与 Maven 失败

使用 FunctionalTestCase 测试异步 Mule Flow

java - 骡子错误--2。调用方法失败。消息有效负载的类型为字符串

java - Odata 与 Olingo 或 Odata4j

java - 异常堆栈上的 Mule JUnit 测试

csv - 如何在 Mule 中读取巨大的 CSV 文件