The right way to turn an EAR module into an OSGI package

There is a need to turn part of the EAR (namely, war) into an OSGI package and maintain its compatibility. Glassfish 3.0.1 already has a module osgi-web-container, and I managed to deploy the standalone OSGI war.

But in the event of a war with former enterprises, this is a little difficult for me.

  • What should I do with EJB calls from within the future OSGI war? Is it enough to replace @EJBinjections with true JNDI searches?
  • What about APIs and libraries sharing via EAR? I could separate and regroup them, but I still have at least one jar needed for both the EAR and OSGI wars. Duplicate, do it like an OSGI package and make it accessible to the ear, somehow, put it GF domain library path?
  • Any other ideas, tips that could make this hybrid work?
+3
source share
1 answer

Here are some things you can try:

  • No need to replace @EJBwith JNDI search. Yours @EJBwill continue to work even inside your OSGi War (aka WAB).
  • You can install the shared library as a package, then it will be visible for both the OSGi war and the outdated EAR / WAR.

I suggest you follow the GlassFish forum .

+2
source

Source: https://habr.com/ru/post/1785708/


All Articles