在 J2EE/Weblogic 10 上使用相同的类加载器共享接口类,而不使用系统类路径
我有一个在 Weblogic 10.0(或 10.3)应用程序服务器上运行的“框架”,其中该框架由多个企业应用程序组成,每个企业应用程序负责不同的资源适配器。客户端应用程序部署到域中,使用 JNDI 获取对资源适配器连接器类之一的引用,执行其调用,每个人都很高兴。
祖先给我留下了连接器的接口类以及系统类路径上的其他类 - 这工作得很好。
新的要求是消除“污染”系统类路径,并尽可能降低对体系结构的影响。我尝试了 WLS 特定的“共享 J2EE 库”,但必须看到,虽然我可以将接口类打包到库中并在其他应用程序中引用它们,但这些类仍然由单独的应用程序类加载器加载,这样我就得到了当我尝试将 JNDI 查找的对象转换为接口时,出现 ClassCastException。
您建议了解什么?目前,我建议客户为该框架使用带有系统类路径条目的单独域,但不确定他们是否会接受。
谢谢!
I have a "framework" running on a Weblogic 10.0 (or 10.3) appserver, where the framework consists of multiple enterprise apps, each responsible for a different resource adapter. A client application gets deployed into the domain, uses JNDI to obtain reference to one of the resource adapter Connector classes, does its invocations and everyone is happy.
The ancestors left me with interface classes for the Connectors and else on the system classpath - this works fine.
The new requirement is to eliminate "polluting" the system classpath, with as low architectural impact as possible. I tried the WLS-specific "shared J2EE libs", but had to see that although I can package the interface classes to a library and reference them in other apps, the classes are still loaded by the separate app classloaders, and this way I get a ClassCastException when I try to cast the JNDI-lookup'd object into the interface.
What do you suggest to do know? Currently I would advise clients to use a separate domain for this framework with system classpath entries, but not sure they would accept it.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我会得出结论,这是不可能的。我认为正确的解决方案是重写应用程序以使用远程 EJB 调用进行应用程序间通信。
另请参阅 需要帮助了解 JNDI 和 J2EE 中的特定 ClassCastException
Ok, I will conclude then that this is not possible. I think a proper solution would be to rewrite the application to use remote EJB invocations for inter-app communication.
See also Need help understanding JNDI and a particular ClassCastException in J2EE