如何在weblogic启动时让其加载指定的jar库文件

项目使用了某第三方公司提供的一个jar包,且那个jar包必须在容器启动的classpath内,不能在application的classpath内。

起初是修改weblogic中domain的启动文件,想把jar的路径set进去,但是修改了startWeblogic.sh和setDomainEnv.sh都不行,比较郁闷。

后来突然想起,tomcat有个common目录,下面有个lib目录,tomcat在启动的时候会自动加载lib目录下的jar,那weblogic也应该有个类似的东东才对。

翻了翻weblogic domain的目录,发现domain下有个lib目录,里面有个说明文件这么写到:

this is the domain library directory and is usually located at $DOMAIN_DIR/lib.

The jars located in this directory will be picked up and added dynamically to the end of the server classpath at server startup. The jars will be ordered lexically in the classpath. The domain library directory is one mechanism that can be used for adding application libraries to the server classpath.

It is possible to override the $DOMAIN_DIR/lib directory using the -Dweblogic.ext.dirs system property during startup. This property specifies a list of directories to pick up jars from and dynamically append to the end of the server classpath using java.io.File.pathSeparator as the delimiter between path entries.

意思大致就是,凡是放在这个目录里的jar文件,都会在weblogic启动的时候自动追加到classpath里,可以被application引用。

问题圆满解决,不过解决之前花了好久修改启动文件 囧rz......

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值