With OSGi becoming the runtime container of choice, there needs to be ways to deploy different types of archives. Deploying a WAR file is also supported within the Karaf container. In order to get a WAR file to deploy correctly and start, the war
feature needs to be installed first. Luckily, we have already started the war
feature several times throughout this chapter. In case the Karaf instance has been reset to a clean slate, let's install the war
feature again:
karaf@root> features:install war
There, simple enough, now we are ready to install a WAR file of choice.
For this example I am using the non-OSGi-compliant sample.war
file from Apache Tomcat available at http://tomcat.apache.org/tomcat-5.5-doc/appdev/sample/sample.war.
Just like the JAR file, the WAR file can be dropped in the [karaf]/deploy
directory and it will be picked up, transformed to OSGi-compliant, installed, and started:
[ 88] [Active ] [ ] [ 80] sample (0.0.0)
Once it is installed and...