Using JACORB in OSGI

I am trying to use JACORB from am OSGI-Bundle. I read about people who had a lot of problems with its launch and launch. Do any of you have experience working with the inclusion of JaCORB in the OSGi-Bundle?

Thanks Moritz

+4
source share
2 answers

CORBA, as a rule, you need to create a lot of class-specific code, and I doubt that JACORB is going to do it in a class-safe way from the package (since it no doubt needs access to other classes for this to happen).

If you really need to do this, add:

DynamicImport-Package: * 

JACORB will provide complete access to your (exported) packages as part of the package. Please note that this means that when JACORB is bound to your specific version of the package, it will not be dynamic (i.e., it will be constantly connected to the life of your package).

You might want to check out the remote OSGi services; there are many different implementations that provide network services; e.g. Eclipse ECF or Apache CXF .

If you just need to call the client via OSGi, then it might be better to link the internal copy of JACORB in your package (so that it sees what your package sees), and then configure the bundle class path with:

 Bundle-ClassPath: .,jacorb.jar 

This way, your client will be able to access the remote CORBA service, but not (easily) incoming requests. Also note that there may be several singleton resources (e.g., IIOR port), which may mean that you are limited to using this trick once for the OSGi VM.

+3
source

You tried to use a fragment of the system. We ran into this problem, having Jacorb in both the AND bundle and the system fragment. This is a little unorthodox, but it really works.

  • Create a package (org.jacorb) and wrap all existing jacorb jars. Set packages. This means that you can evaluate jacorb classes if necessary.
  • Create a fragment in which the host node is system.host. Add all jacorb jars here. Thus, when the JVM is sent to create the ORB, it can successfully find the ORB class, which would normally not be in your class path if you were not dependent on the jacorb package.

Voila! Now all your plugins do not need jacorb dependencies, and you use jacorb, as always, with Java System properties.

0
source

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


All Articles