java – Weblogic 10.3. 1.0 is using COM bea. core. apache. commons. net_ 1.0. 0.0_ 1-4-1. Jar… I want to use commons-net-2.0 Jar from my code
Weblogic 10.3. 1.0 is using COM bea. core. apache. commons. net_ 1.0. 0.0_ 1-4-1. Jar... I want to use commons-net-2.0 from my code jar.
How do I force it to use newer jars in my code?
Solution
Weblogic uses the first strategy of parent loader. You basically have two options to adjust this behavior:
>In Weblogic XML, use the preferred web inf classes element, web application deployment descriptor (web. XML next to WEB-INF) ~ or ~ > package your war insider into ear, and use your Weblogic application Weblogic filtering classloader configured in the XML descriptor (configured in application.xml next to meta INF),
Here is a Weblogic XML example:
<?xml version="1.0" encoding="UTF-8"?> <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic- web-app.xsd"> <container-descriptor> <prefer-web-inf-classes>true</prefer-web-inf-classes> </container-descriptor> </weblogic-web-app>
Here is a Weblogic application XML example:
<?xml version="1.0" encoding="UTF-8"?> <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90"> <application-param> <param-name>webapp.encoding.default</param-name> <param-value>UTF-8</param-value> </application-param> <prefer-application-packages> <package-name>javax.jws.*</package-name> </prefer-application-packages> </weblogic-application>
The former option is simpler, but global for webapp If you don't use ear packaging at present, but provide better control, and later introduce more complexity
You can also have a look
> Understanding WebLogic Server Application Classloading