从Wildfly的全球图书馆实例化部署的课程

发布于 2025-02-09 03:05:12 字数 221 浏览 1 评论 0原文

在我的野生环境中,我有一个全球库,该库由不同的应用程序部署使用。这些不同的应用程序部署包括该全球库的自定义。

但是,全球图书馆保留了实际实例化这些自定义的责任。我提供所需的班级名称,然后在初始化时通过自己的类负载来实例化。

但是,当我这样做时,它会引发classNotFoundException。有没有办法可以“通知”全局库类负载程序,该软件包确实存在,还是我唯一以某种方式自定义类加载程序的途径?

In my Wildfly environment I have a global library that is used by disparate application deployments. Those disparate application deployments include customizations for that global library.

However, that global library retains responsibility for actually instantiating those customizations. I provide the class name that it needs and then it instantiates them via its own classloader upon initialization.

However, when I do that it throws a ClassNotFoundException. Is there a way to "notify" the global library classloader that the package does, indeed, exist, or is my only path forward to customize the class loader in some way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苯莒 2025-02-16 03:05:13

感谢 James Perkins 寻求帮助。似乎最可行的解决方案(我不知道最好的解决方案)是将功能性库移动,这构成了大部分部署的一小部分,而是将模型库放入一般的LIB中文件夹。模型库无需参考已部署的战争,因此它们可以按照需要的方式进行全局。通过将功能库放置在战争中,他们可以看到我所做的自定义。

Thanks to James Perkins for the help. It seems as though the most workable solution (I don't know if it's best) was to move the functional libraries, which constituted a fraction of the bulk of the deployment, into the WAR, but to place the model libraries in the general lib folder. The model libraries don't need to refer back to deployed WAR so they can be as global as they need to be. By placing the functional libraries in the WAR they are able to see the customizations that I made.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文