问题
We have a weblogic ear which has dependency with a third party jar. We don't want to keep this jar inside of the ear. Is there any other better way or better place to keep this jar and load it only at the ear class loader.
回答1:
I personally would package the third party jar into the ear. You have a couple of other options...
Add the jar file into your weblogic domain lib directory, this will put it on the classpath for every server:
<domain folder> -> lib
A better way would be to edit your server classpath to also include the third party jar. Login to your admin console and edit:
Servers -> server_name -> Server Start tab -> Classpath
Keep in mind this will put the jar on the classpath for all apps running on that particular server. If that is not desirable you can look into preferring the jar(s) in your ear file over those on the classpath like:
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>org.xml.sax.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
来源:https://stackoverflow.com/questions/30485120/weblogic-ear-external-jar-dependency