Weblogic 10.3.5覆盖Spring版本 [英] Weblogic 10.3.5 Overriding Spring Version

查看:220
本文介绍了Weblogic 10.3.5覆盖Spring版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Oracle的OEPE发行版(包括Weblogic服务器10.3.5)开发Web应用程序. WLS包含自己的Spring版本,该版本似乎是2.5.6.SEC01.但是,我们正在尝试使用特定于3.1发行版的Spring和Spring Security功能.

I am developing a web application using Oracle's OEPE distribution, including Weblogic server 10.3.5. WLS includes its own version of Spring, which appears to be 2.5.6.SEC01. However, we are trying to use Spring and Spring Security features specific to the 3.1 release.

Maven POM将Spring Version定义为3.1.1.RELEASE的属性(该属性已插入到各节中,即:

The Maven POM defines the Spring Version as a property to be 3.1.1.RELEASE (with that property plugged in to the sections, i.e.:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>${spring.version}</version>
</dependency>

我在weblogic.xml中尝试了两种单独的方法来排除内置的Spring(下面注释了一种,但是请放心,我已经尝试了两种方法):

I've try two separate ways in weblogic.xml of excluding the built-in Spring (one is commented out below, but rest assured I've tried both):

<wls:container-descriptor>
    <wls:prefer-application-packages>
        <wls:package-name>com.oracle.ojdbc16.*</wls:package-name>
        <wls:package-name>antlr.*</wls:package-name>
        <wls:package-name>javax.persistence.*</wls:package-name>
        <wls:package-name>org.apache.commons.*</wls:package-name>
        <wls:package-name>org.springframework.*</wls:package-name>
        <wls:package-name>org.hibernate.*</wls:package-name>
        <wls:package-name>org.apache.xerces.*</wls:package-name>
    </wls:prefer-application-packages>
    <!-- <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes> -->
</wls:container-descriptor>

使用我自己的Spring版本,我该怎么做?

What in the world do I have to do to use my own version of Spring?

推荐答案

选项1:将Spring 3.x应用程序部署到未安装JRF的域中的wls服务器.对我有用.

OPTION1: Deploy your Spring 3.x app to a wls server in a domain that does not have JRF installed. That works for me.

选项2:在weblogic.xml中使用preferred-web-inf-classs并作为战争部署.这对我来说适用于wls 10.3.6,JRF域,Spring 3.2.2.我无法使Preferred-Application-Package起作用,但Preferred-web-inf-classs起作用了.

OPTION2: use prefer-web-inf-classes in weblogic.xml and deploy as a war. This worked for me with wls 10.3.6, JRF domain, Spring 3.2.2. I couldn't get prefer-application-packages to work, but prefer-web-inf-classes did.

注意:在安装了JRF的域中,我尝试了war/weblogic.xml/prefer-application-packages和ear/weblogic-application.xml/prefer-application-packages方法,但都没有效果.我有一个测试jsp,它输出org.springframework.core.SpringVersion.getVersion(),尽管我付出了很多努力,但它仍然坚持报告2.5.6.SEC01(这是oracle_common/modules文件夹中捆绑的Spring版本).

NOTES: With a domain that does have JRF installed, I've tried both the war/weblogic.xml/prefer-application-packages and ear/weblogic-application.xml/prefer-application-packages approaches and neither seems effective. I have a test jsp that outputs org.springframework.core.SpringVersion.getVersion() and it persists in reporting 2.5.6.SEC01 despite my efforts (this is the version of Spring bundled in the oracle_common/modules folder).

但是,在非JRF域中部署相同的应用程序,并且org.springframework.core.SpringVersion.getVersion()将报告与应用程序捆绑在一起的spring的任何版本.

Deploy the same app in a non-JRF domain though, and org.springframework.core.SpringVersion.getVersion() will report whatever version of spring you bundled with your app.

这篇关于Weblogic 10.3.5覆盖Spring版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆