In some case, Java EE applications you want to execute need specifics JOnAS services to run correctly. If the required services are already started, that means you have defined in the jonas.services property of the JOnAS configuration file the list of the services you want to start, there is no special things to do. But it may be not the case for many reasons. One of them is that you didn't need thoses services before deploying your applications.
To ensure that a set of JOnAS services will be started before deploying a Java
EE application, you have to set the
Require-JOnAS-Services attribute in the root
manifest file of the archive. The value of this property is a
comma-separed list of JOnAS service names. Service names must match with the
ones defined in the jonas.properties
configuration
file. In case of an EAR archive, there is no need to modify the manifest
files of the embedded JARs, WARs, RARs or CARs archives.
During the deployment phase of an Java EE archive, the manifest file is analysed to check if the Require-JOnAS-Services property exists. For each declared service, the server verifies wheither the service is already started. If not, two operations should be performed:
Install/start bundles for the required service if needed
Create configuration for the required service
After that, the service should be started and the application can also be started.
Note | |
---|---|
If the application is undeployed, there is at the moment no ways to specify if these service dependencies should also be stopped or uninstalled. |
The addition of the manifest attribute during a maven build can be automated by configurating the maven plugin like below.
... <configuration> <archive> <manifestEntries> <Require-JOnAS-Services>service1,service12,..,servicen</Require-JOnAS-Services> </manifestEntries> </archive> </configuration> ...
More info may be found here.