weblogic 上的类路径和类加载
我正在尝试在 weblogic (10.3.2.0) 中创建和动态加载类。这是我部署到 weblogic 服务器的 ADF 应用程序。
当我打印时,
((GenericClassLoader)this.getClass().getClassLoader()).getFinderClassPath()
我看到我的目录的路径(当然不仅仅是这个路径)
C:\...\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\tmp\_WL_user\test\753the\dynamicClasses
(我已将目录dynamicClasses添加到部署WAR配置文件的清单)。 在此目录中我创建类文件。我检查过,确实在那里创建了文件。 当我尝试使用相同的类加载器加载创建的类(我已为其打印类路径)时,会引发 ClassNotFoundException。
它知道包含类的目录和 jar 文件的路径,但它不加载类。
使用 URLClassLoader 我可以加载类。但我需要这样我的类才能被“通常”方式加载的类看到。
我只需使用系统CLASSPATH就可以正确运行它。
请问您知道解释吗? WAR 中的清单文件指定类路径的位置是否错误?
提前谢谢你
Qjeta
I am trying to create and load dynamically classes in weblogic (10.3.2.0). It is ADF application which I deploy to the weblogic server.
When I print
((GenericClassLoader)this.getClass().getClassLoader()).getFinderClassPath()
I see the path to my directory (of course not just this path)
C:\...\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\tmp\_WL_user\test\753the\dynamicClasses
(I have added directory dynamicClasses to manifest for deployment WAR profile).
In this directory I create class files. I have checked it, files are really created there.
When I try to load created class with the same classloader, for which I have printed classpath, ClassNotFoundException is thrown.
It knows the path to the directory with classes and to jar file, but it doesn't load classes.
With URLClassLoader I can load classes. But I need so that my classes would be seen by the classes loaded "usual" way.
I am able to run it correctly just with system CLASSPATH.
Please, do you know an explanation? Is the manifest file in WAR the wrong place for specifiing classpath?
Thank you in advance
Qjeta
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过使用尾部斜杠
C:...\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\tmp_WL_user\test\753the\dynamicClasses\
或者它是否仅适用于通过 MANIFEST 文件给出的 jar 名称,而不是目录名称。
Have you tried with the trailing slash
C:...\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\tmp_WL_user\test\753the\dynamicClasses\
Or does it only work with jar names if given via the MANIFEST file, and not with directory name.