You must locate the /src/main/resources/META-INF/MANIFEST.MF file in your service JAR bundle and ensure that the Java service package is exported. To export the package, the following line must appear in the
MANIFEST.MF file:
In the example line, com.vmware.myService is the name of the service package you created.
You add your service to the Spring configuration on the Virgo server by creating a <bean> element in the Spring configuration file. In the JAR bundle, locate the
/src/main/resources/META-INF/spring/bundle-context.xml file. The file contains a
<beans> XML element containing services in the configuration. Add your service as a new
<bean> as follows:
The name attribute is the name of your service implementation, and the
class attribute contains the class you created that implements the service interface.
You must also expose the service interface as an OSGI bundle in the Spring framework. In the JAR bundle, locate the /src/main/resources/META-INF/spring/bundle-context-osgi.xml file. This file also contains a
<beans> XML element. Add your service using the following line:
The id attribute is the name of your service, the
ref element specifies the service implementation you added to the
bundle-context.xml file, and the
interface element contains the class that defines the service interface.