Weblogic 10 共享库未显示在引用应用程序中
在 WebLogic 10.0 上,我使用“共享 J2EE 库”( http: //download.oracle.com/docs/cd/E11035_01/wls100/programming/libraries.html ) WLS 的功能可对需要在多个耳朵中访问的一些 jar 进行分组。这些 jar 驻留在系统类路径中,我尝试将它们从那里移动到共享库中。
我的问题是:
- 在 WLS Web 管理控制台中,我单击部署下的共享库(名为“theSharedLib”),
- “引用此库的应用程序”列表为空
- 我也可以使用 weblogic.Deployer 取消部署该库,但在下次重新启动时服务器的它抱怨在加载引用应用程序时缺少引用的库
因此,似乎在启动时引用生效,但在运行时WLS以某种方式忘记了这一点(这里我需要一些魔术吗?)。
我也可以实现这一点:
- 取消部署 theSharedLib (没有抱怨)
- 取消部署 someReferencingApp (确定
- )部署 someReferencingApp (错误!缺少 lib)
- 部署 theSharedLib (确定)
- 部署 someReferencingApp (确定;应用程序在 Web 控制台中列出;但是在下次重新启动时或之后随机其他部署,列表再次变空)
分解目录格式的共享lib Ear的结构:
- META-INF
- MANIFEST.MF
- application.xml
- 库
- (我需要以罐子形式分享的东西)
- dummyejb.jar (因为它必须包含某些内容)
MANIFEST.MF 包含:
..
扩展名称:theSharedLib
规范版本:1.0
实施版本:1.0.0
..
application.xml 包含基本元素(一个 dummyejb ejb 模块)。
引用应用程序的结构:
其中有META-INF/weblogic-application.xml,其中包含:
<图书馆参考>
<库名称>theSharedLib
<规范版本>1.0
<实现版本>1.0.0
<精确匹配>true
可能是什么问题?我是否应该在共享库或引用应用程序中执行其他操作,以(1)正确引用列表,最重要的是(2)在应用程序之间共享 jar?
我假设库中的共享 jar 是使用每个应用程序的共享库中相同的类加载器来加载的,其行为与 sys 类路径行为非常相似。您能否也证实一下?
谢谢!
On WebLogic 10.0 I use the "Shared J2EE Libraries" ( http://download.oracle.com/docs/cd/E11035_01/wls100/programming/libraries.html ) feature of WLS to group some jars which would need to be accessible in multiple ear's. These jars resided on the system classpath, and I try to move them into the shared lib from there.
My problem is:
- in the WLS web admin console I click the shared library (named "theSharedLib") under Deployments
- the "Applications that reference this Library" list is empty
- I can also undeploy the lib using weblogic.Deployer, but on the next restart of the server it complains about the referenced library missing when loading the referencing application
So it seems that at startup the referencing takes effect, but in runtime WLS somehow forgets about this (do I need some magic trick here?).
I could also achieve this:
- undeploy theSharedLib (no complaining)
- undeploy someReferencingApp (ok)
- deploy someReferencingApp (error! missing lib)
- deploy theSharedLib (ok)
- deploy someReferencingApp (ok; app gets listed in the web console; however on next restart, or after random other deployments, the list gets empty again)
Structure of shared lib ear in exploded directory format:
- META-INF
- MANIFEST.MF
- application.xml
- lib
- (stuff I need to share as jars)
- dummyejb.jar (because it has to contain something)
MANIFEST.MF contains:
..
Extension-Name: theSharedLib
Specification-Version: 1.0
Implementation-Version: 1.0.0
..
application.xml contains basic elements (one dummyejb ejb module).
Structure of referencing app:
Among others, it has META-INF/weblogic-application.xml, containing:
<?xml version="1.0"?>
<weblogic-application>
<library-ref>
<library-name>theSharedLib</library-name>
<specification-version>1.0</specification-version>
<implementation-version>1.0.0</implementation-version>
<exact-match>true</exact-match>
</library-ref>
</weblogic-application>
What could be the problem? Should I do anything else in the shared lib or in the referencing apps to (1) have the references list correctly and most importantly (2) share the jars among the apps?
I presume the shared jars inside the lib are loaded using the same classloader in the shared lib for each application, behaving pretty much like the sys classpath behavior. Could you please also confirm this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢您提供信息。实际上,这是我发现的:
1)如果引用应用程序在部署时失败,引用应用程序的列表将从 Web 控制台中消失(奇怪 - 也许它有更深层次的原因,但现在这是相当一致的)。
2)不幸的是,共享库中的类是由不同引用应用程序的类加载器加载的,因此这样就不可能共享用于应用程序间通信的接口类。
Thanks for the information. Actually this is what I found out:
1) The listings of referencing applications disappear from the web console, if a referencing application fails at deployment (strange - maybe it has deeper reasons, but this is quite consistent now).
2) Unfortunately the classes inside a shared lib are loaded by the classloaders of the different referencing applications, so this way it is not possible to share for example interface classes for inter-application communication purposes.
我认为共享库(它是一个 EAR)的 MANIFEST.MF 应该包含一个引用 lib 中 JAR 的
Class-Path
条目(这告诉类加载器在哪里寻找类)。像这样的事情:I think that the MANIFEST.MF of the shared lib (which is an EAR) should contain a
Class-Path
entry referencing the JARs in lib (this tells the classloader where to look to find classes). Something like this: