EAR 的 APP-INF/lib 内 JAR 加载顺序
在 EAR 内的 META-INF 目录中添加具有 Class-Path 属性的 MANIFEST.MF 文件是否会影响位于 WebLogic 8.1 下 APP-INF/lib 中的 JAR 的加载顺序?
Will adding a MANIFEST.MF file with Class-Path attribute to META-INF directory inside EAR influence the order of loading of JARs located in APP-INF/lib under WebLogic 8.1?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不相信您可以通过 MANIFEST.MF 的 ClassPath 属性控制 APP-INF/lib 顺序。
根据客户的不同,我采用了几种不同的方法。
I don't believe you can control the APP-INF/lib order via ClassPath attribute of MANIFEST.MF.
I've done this a couple different ways, depending on the client.
我认为类加载器会读取应用程序所需的 JAR。
我有两个问题想问你:
更新:
这听起来不同,几乎就像您与服务器 JAR 发生冲突一样。就是 prefer-web-inf-classes 针对这种情况的设置。你是这个意思吗?
I thought the class loader read JARs as they're required by your application.
I have two questions for you:
UPDATE:
That sounds different, almost as if you were having conflicts with server JARs. There's that prefer-web-inf-classes setting for that situation. Is that what you mean?
我同意 duffymo
您不必担心类加载的顺序,如果这是由于您的类冲突造成的始终可以使用 Maven 或类似工具从 Jars 中排除冲突的类。
例如,这是一个添加 jersey-spring4 jar 的非常简单的示例,但我排除了它的依赖项,以便我可以使用不同版本的 spring 框架库。
I agree with duffymo
You shouldn't have to worry about the order of class loading, if this is due to conflicting classes you can always exclude the conflicting classes from Jars using Maven or a similar tool.
For instance this is a very simple example of adding jersey-spring4 jar but I'm excluding its dependencies so I can use a different version of the spring framework library.