I am trying to run my application on weblogic server.
I have specified the required jars in the required versions in the pom file of my application.
At run time the server is referencing the jar from
$Middleware_Home/oracle_common/modules which has an older version of the jar.
How do i update the version in this folder? or make the server refer to the version specified in my pom file.
Add a comment
|
1 Answer
In your weblogic-application.xml file, you can add the <prefer-application-packages> element. It would like the below.
<weblogic-application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.oracle.com/weblogic/weblogic-application"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.0/weblogic-application.xsd">
<classloader-structure>
<module-ref>
<module-uri>appname.war</module-uri>
</module-ref>
</classloader-structure>
<session-descriptor>
<cookie-path>/appname</cookie-path>
</session-descriptor>
<prefer-application-packages>
<package-name>org.apache.logging.log4j.* </package-name>
</prefer-application-packages>
</weblogic-application>
Alternatively, You can use the prefer-web-inf-classes element in your weblogic.xml file and set it to true. Please note that you if use this, the prefer-application-packages will be ignored. More about it Here
<?xml version='1.0' encoding='UTF-8'?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd
http://xmlns.oracle.com/weblogic/weblogic-web-app
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.9/weblogic-web-app.xsd">
<wls:container-descriptor>
<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>
<wls:context-root>appname</wls:context-root>
</wls:weblogic-web-app>