correct way to turn EAR module into OSGI bundle

耗尽温柔 提交于 2019-12-10 10:25:19

问题


There is a necessity to turn part of EAR (namely - war) into OSGI bundle and retain it's interoperability. Glassfish 3.0.1 already has osgi-web-container module and I succeeded to deploy standalone OSGI war.

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? Is it enough to replace @EJB injections with true JNDI lookups?
  2. What about APIs and libraries shared across EAR? I could split and rearrange them, but still I will have at least one jar needed by both EAR and OSGI war. Duplicate, make it as OSGI-bundle itself and make it available to ear somehow, place it GF domain's library path?
  3. Any other ideas, advices which could make that hybrid working?

回答1:


Here are a few things to try out:

  • No need to replace @EJB by JNDI lookup. Your @EJB will continue to work even inside your OSGi War (aka 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.

I suggest you follow up in GlassFish forum.



来源:https://stackoverflow.com/questions/4704729/correct-way-to-turn-ear-module-into-osgi-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!