问题
We have been facing an issue while overriding the Spring jar in Weblogic 12c. Basically we need to write a bean based on some 3rd party API calling their interfaces. Now they use Spring 2.5 jar for their own implementation. Since Weblogic inherently supports Spring 3.0 jar. As a result when we write our bean wrapping their interfaces and deploy it, it doesn't work. We replicated the issue by replacing Spring 2.5 jar with Spring 3 in local environment.
If we modify the server classpath to load the Spring 2.5 jar (preceding Spring 3.0), entire soa-infra application goes down, so what We wanted to know if it is possible to override the Spring jar only for our application itself? While loading the application it will override the Spring 3.0 jar with Spring 2.5 in the application context but server will keep using Spring 3.0?
Any ideas/suggestions highly appreciated!
Thanks, Bhaskar
回答1:
Try using prefer-application-packages in your weblogic.xml file.
<container-descriptor>
<prefer-application-packages>
<package-name>org.springframework</package-name>
<prefer-application-packages>
</container-descriptor>
来源:https://stackoverflow.com/questions/29350631/override-spring-jar-in-weblogic-12c