简体   繁体   English

将EAR模块转换为OSGI包的正确方法

[英]correct way to turn EAR module into OSGI bundle

There is a necessity to turn part of EAR (namely - war) into OSGI bundle and retain it's interoperability. 有必要将EAR的一部分(即 - 战争)转变为OSGI捆绑并保持其互操作性。 Glassfish 3.0.1 already has osgi-web-container module and I succeeded to deploy standalone OSGI war. Glassfish 3.0.1已经有了osgi-web-container模块,我成功地部署了独立的OSGI战争。

But in case of of ex-enterprise war it looks a bit difficult to me. 但是在前企业战争的情况下,对我来说看起来有点困难。

  1. What do I do with EJB calls from inside future OSGI war? 从未来的OSGI战争中我如何处理EJB调用? Is it enough to replace @EJB injections with true JNDI lookups? 是否足以用真正的JNDI查找替换@EJB注入?
  2. What about APIs and libraries shared across EAR? 那么在EAR中共享的API和库呢? I could split and rearrange them, but still I will have at least one jar needed by both EAR and OSGI war. 我可以拆分并重新安排它们,但是我仍然需要EAR和OSGI战争所需的至少一个罐子。 Duplicate, make it as OSGI-bundle itself and make it available to ear somehow, place it GF domain's library path? 复制,使其成为OSGI-bundle本身,并以某种方式使其可用于耳朵,将其置于GF域的库路径?
  3. Any other ideas, advices which could make that hybrid working? 任何其他想法,可以使混合动力工作的建议?

Here are a few things to try out: 以下是一些可以尝试的方法:

  • No need to replace @EJB by JNDI lookup. 无需通过JNDI查找替换@EJB Your @EJB will continue to work even inside your OSGi War (aka WAB). 你的@EJB将继续在你的OSGi战争(又名WAB)内部工作。
  • You can install the shared library as a bundle, then it will be visible to both OSGi war as well as legacy EAR/WAR. 您可以将共享库作为捆绑包安装,然后它将对OSGi war以及旧版EAR / WAR可见。

I suggest you follow up in GlassFish forum . 我建议你跟进GlassFish论坛

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM