Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

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>

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>

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
386 views
Welcome To Ask or Share your Answers For Others

1 Answer

I had the same problem. The solution was to create weblogic-application.xml into the META-INF folder of EAR project. Here is the code.

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application>
    <prefer-application-packages>
        <package-name>org.apache.*</package-name>
        <package-name>org.springframework.*</package-name>
    </prefer-application-packages>
</weblogic-application>

Maybe your problem is that you're using weblogic.xml into WAR project instead of weblogic-application.xml into EAR project.

Hope it helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...