Author: jbonofre Date: Wed Feb 9 10:50:24 2011 New Revision: 1068835 URL: http://svn.apache.org/viewvc?rev=1068835&view=rev Log: [KARAF-434] Add wrap deployer documentation.
Modified: karaf/trunk/manual/src/main/webapp/users-guide/deployer.conf Modified: karaf/trunk/manual/src/main/webapp/users-guide/deployer.conf URL: http://svn.apache.org/viewvc/karaf/trunk/manual/src/main/webapp/users-guide/deployer.conf?rev=1068835&r1=1068834&r2=1068835&view=diff ============================================================================== --- karaf/trunk/manual/src/main/webapp/users-guide/deployer.conf (original) +++ karaf/trunk/manual/src/main/webapp/users-guide/deployer.conf Wed Feb 9 10:50:24 2011 @@ -64,36 +64,123 @@ NB: you can use the -v or --verbose opti karaf@root> features:install -v war Installing feature war 2.99.99-SNAPSHOT Installing feature http 2.99.99-SNAPSHOT -Installing feature jetty 7.1.6.v20100715 +Installing feature jetty 7.2.2.v20101205 Installing bundle mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.1.2 -Found installed bundle: org.apache.servicemix.bundles.asm [10] -Installing bundle mvn:org.eclipse.jetty/jetty-util/7.1.6.v20100715 -Installing bundle mvn:org.eclipse.jetty/jetty-io/7.1.6.v20100715 -Installing bundle mvn:org.eclipse.jetty/jetty-http/7.1.6.v20100715 -Installing bundle mvn:org.eclipse.jetty/jetty-continuation/7.1.6.v20100715 -Installing bundle mvn:org.eclipse.jetty/jetty-server/7.1.6.v20100715 -Installing bundle mvn:org.eclipse.jetty/jetty-security/7.1.6.v20100715 -Installing bundle mvn:org.eclipse.jetty/jetty-servlet/7.1.6.v20100715 -Installing bundle mvn:org.eclipse.jetty/jetty-xml/7.1.6.v20100715 +Found installed bundle: org.apache.servicemix.bundles.asm [9] +Installing bundle mvn:org.eclipse.jetty/jetty-util/7.2.2.v20101205 +Installing bundle mvn:org.eclipse.jetty/jetty-io/7.2.2.v20101205 +Installing bundle mvn:org.eclipse.jetty/jetty-http/7.2.2.v20101205 +Installing bundle mvn:org.eclipse.jetty/jetty-continuation/7.2.2.v20101205 +Installing bundle mvn:org.eclipse.jetty/jetty-server/7.2.2.v20101205 +Installing bundle mvn:org.eclipse.jetty/jetty-security/7.2.2.v20101205 +Installing bundle mvn:org.eclipse.jetty/jetty-servlet/7.2.2.v20101205 +Installing bundle mvn:org.eclipse.jetty/jetty-xml/7.2.2.v20101205 Checking configuration file mvn:org.apache.karaf/apache-karaf/2.99.99-SNAPSHOT/xml/jettyconfig -Installing bundle mvn:org.ops4j.pax.web/pax-web-api/0.8.2-SNAPSHOT -Installing bundle mvn:org.ops4j.pax.web/pax-web-spi/0.8.2-SNAPSHOT -Installing bundle mvn:org.ops4j.pax.web/pax-web-runtime/0.8.2-SNAPSHOT -Installing bundle mvn:org.ops4j.pax.web/pax-web-jetty/0.8.2-SNAPSHOT -Installing bundle mvn:org.ops4j.pax.web/pax-web-jsp/0.8.2-SNAPSHOT -Installing bundle mvn:org.ops4j.pax.web/pax-web-extender-war/0.8.2-SNAPSHOT -Installing bundle mvn:org.ops4j.pax.web/pax-web-extender-whiteboard/0.8.2-SNAPSHOT -Installing bundle mvn:org.ops4j.pax.web/pax-web-deployer/0.8.2-SNAPSHOT -Installing bundle mvn:org.ops4j.pax.url/pax-url-war/1.2.4 +Installing bundle mvn:org.ops4j.pax.web/pax-web-api/1.0.0 +Installing bundle mvn:org.ops4j.pax.web/pax-web-spi/1.0.0 +Installing bundle mvn:org.ops4j.pax.web/pax-web-runtime/1.0.0 +Installing bundle mvn:org.ops4j.pax.web/pax-web-jetty/1.0.0 +Installing bundle mvn:org.apache.karaf.shell/org.apache.karaf.shell.web/2.99.99-SNAPSHOT +Installing bundle mvn:org.ops4j.pax.web/pax-web-jsp/1.0.0 +Installing bundle mvn:org.ops4j.pax.web/pax-web-extender-war/1.0.0 +Installing bundle mvn:org.ops4j.pax.web/pax-web-extender-whiteboard/1.0.0 +Installing bundle mvn:org.ops4j.pax.web/pax-web-deployer/1.0.0 +Installing bundle mvn:org.ops4j.pax.url/pax-url-war/1.2.5 {code} -You should now be able to see the war deployer: +As you can see, the war feature uses PAX Web as war deployer. + +You should now be able to see the PAX Web war deployer: {code} -karaf@root> osgi:list |grep "WAR Deployer" -[ 42] [Active ] [Created ] [ 60] Apache Karaf :: WAR Deployer (2.0.1.SNAPSHOT) +karaf@root> osgi:list |grep -i war +[ 57] [Active ] [ ] [ 60] OPS4J Pax Web - Extender - WAR (1.0.0) +[ 60] [Active ] [ ] [ 60] OPS4J Pax Url - war:, war-i: (1.2.5) {code} You can deploy a web application packaged in war or exploded in a directory. -Your web application should at least contain a WEB-INF/web.xml file. \ No newline at end of file +Your web application should at least contain a WEB-INF/web.xml file. + +h2. Wrap deployer + +The wrap deployer allows you to hot deploy non-OSGi jar files ("classical" jar files) from the deploy folder. + +It's a standard deployer (you don't need to install additional Karaf features): + +{code} +karaf@root> la|grep -i wrap +[ 1] [Active ] [ ] [ 5] OPS4J Pax Url - wrap: (1.2.5) +[ 32] [Active ] [Created ] [ 30] Apache Karaf :: Deployer :: Wrap Non OSGi Jar (2.99.99.SNAPSHOT) +{code} + +Karaf wrap deployer looks for jar files in the deploy folder. The jar files is considered as non-OSGi if the MANIFEST +doesn't contain the Bundle-SymbolicName and Bundle-Version attributes, or if there is no MANIFEST at all. + +The non-OSGi jar file is transformed into an OSGi bundle. + +The deployer tries to populate the Bundle-SymbolicName and Bundle-Version extracted from the jar file path. + +For example, if you simply copy commons-lang-2.3.jar (which is not an OSGi bundle) into the deploy folder, you +will see: + +{code} +karaf@root> la|grep -i commons-lang +[ 41] [Active ] [ ] [ 60] commons-lang (2.3) +{code} + +If you take a look on the commons-lang headers, you can see that the bundle exports all packages with optional resolution +and that Bundle-SymbolicName and Bundle-Version have been populated: + +{code} +karaf@root> osgi:headers 41 + +commons-lang (41) +----------------- +Specification-Title = Commons Lang +Tool = Bnd-0.0.357 +Specification-Version = 2.3 +Specification-Vendor = Apache Software Foundation +Implementation-Version = 2.3 +Generated-By-Ops4j-Pax-From = wrap:file:/home/onofreje/workspace/karaf/assembly/target/apache-karaf-2.99.99-SNAPSHOT/deploy/commons-lang-2.3.jar$Bundle-SymbolicName=commons-lang&Bundle-Version=2.3 +Implementation-Vendor-Id = org.apache +Created-By = 1.6.0_21 (Sun Microsystems Inc.) +Implementation-Title = Commons Lang +Manifest-Version = 1.0 +Bnd-LastModified = 1297248243231 +X-Compile-Target-JDK = 1.1 +Originally-Created-By = 1.3.1_09-85 ("Apple Computer, Inc.") +Ant-Version = Apache Ant 1.6.5 +Package = org.apache.commons.lang +X-Compile-Source-JDK = 1.3 +Extension-Name = commons-lang +Implementation-Vendor = Apache Software Foundation + +Bundle-Name = commons-lang +Bundle-SymbolicName = commons-lang +Bundle-Version = 2.3 +Bundle-ManifestVersion = 2 + +Import-Package = + org.apache.commons.lang;resolution:=optional, + org.apache.commons.lang.builder;resolution:=optional, + org.apache.commons.lang.enum;resolution:=optional, + org.apache.commons.lang.enums;resolution:=optional, + org.apache.commons.lang.exception;resolution:=optional, + org.apache.commons.lang.math;resolution:=optional, + org.apache.commons.lang.mutable;resolution:=optional, + org.apache.commons.lang.text;resolution:=optional, + org.apache.commons.lang.time;resolution:=optional +Export-Package = + org.apache.commons.lang;uses:="org.apache.commons.lang.builder,org.apache.commons.lang.math,org.apache.commons.lang.exception", + org.apache.commons.lang.builder;uses:="org.apache.commons.lang.math,org.apache.commons.lang", + org.apache.commons.lang.enum;uses:=org.apache.commons.lang, + org.apache.commons.lang.enums;uses:=org.apache.commons.lang, + org.apache.commons.lang.exception;uses:=org.apache.commons.lang, + org.apache.commons.lang.math;uses:=org.apache.commons.lang, + org.apache.commons.lang.mutable;uses:="org.apache.commons.lang,org.apache.commons.lang.math", + org.apache.commons.lang.text;uses:=org.apache.commons.lang, + org.apache.commons.lang.time;uses:=org.apache.commons.lang + + +{code} \ No newline at end of file