Install Rosette Server as described in the Rosette Server User Guide.
Using the REX SDK in an OSGi Bundle
Note
These steps are only necessary when REX is configured to use linking.
The REX linker uses Java's ServiceLoader
to dynamically discover and load connectors. This functionality does not work well when REX is embedded in an OSGi service bundle without additional configuration, and REX may fail on initialization. To use REX inside an OSGi bundle, we recommend Apache's SPI Fly, a reference implementation of the OSGi ServiceLoader Mediator specification. Follow these steps to configure your OSGi project for REX:
-
Visit https://aries.apache.org/modules/spi-fly.html and follow the instructions to include SPI Fly's Dynamic Weaving OSGi bundle and associated dependencies in your project by either using Maven to manage its dependency or by manually downloading and including them in your project.
-
Add the following lines to MANIFEST.MF
file of the OSGi bundle that embeds the REX SDK:
Require-Capability: osgi.serviceloader;
filter:="(osgi.serviceloader=com.basistech.rosette.flinx.api.service.KnowledgeBaseVariantFactory)";
cardinality:=multiple,osgi.extender;
filter:="(osgi.extender=osgi.serviceloader.processor)",osgi.extender;
filter:="(osgi.extender=osgi.serviceloader.registrar)"
Provide-Capability: osgi.serviceloader;
osgi.serviceloader=com.basistech.rosette.flinx.api.service.KnowledgeBaseVariantFactory
SPI-Consumer: *