You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Installing additional features

This chapter will demonstrate how to add additional features from a remote maven repository to a default installation of the ServiceMix Kernel.

Adding additional maven repositories

The following steps will add in the missing OPS4J and Apache Snapshot maven repositories (this has been fixed in the 1.1.0 release.)

  1. Edit the following file -
    etc/org.ops4j.pax.url.mvn.cfg
    
  2. Update org.ops4j.pax.url.mvn.repositories to include the OPS4J and Apache Snapshot repos -
    org.ops4j.pax.url.mvn.repositories=file:${user.home}/.m2/repository@snapshots,http://repo1.maven.org/maven2,http://repository.ops4j.org/maven2,http://people.apache.org/repo/m2-snapshot-repository<at:var at:name="snapshots" />noreleases
    

Adding additional feature repositories

The following steps will add in the URLs for the ServiceMix NMR and Features locations.

  1. Start the ServiceMix Kernel
    cd bin
    ./servicemix or servicemix.bat
    
  2. Add the following feature install locations
    servicemix> features addUrl mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.0.0-m3/xml/features
    servicemix> features addUrl mvn:org.apache.servicemix.features/apache-servicemix/4.0-m2-SNAPSHOT/xml/features
    
  3. Verify the feature URLs were added -
    servicemix> features listUrl
    mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.0.0-m3/xml/features
    mvn:org.apache.servicemix.features/apache-servicemix/4.0-m2-SNAPSHOT/xml/features
    mvn:org.apache.servicemix.kernel/apache-servicemix-kernel/1.0.0/xml/features
    

Installing a new feature (web)

The following steps will install the "web" feature (support for deploying WAR files with Servlet and JSPs into a Jetty server) into your kernel instance.

  1. List the available features -
    servicemix> features list
     State        Name
    . . .
    [uninstalled] web
    . . .
    
  2. Install the web feature (and the sub-features it requires) -
    servicemix> features install web
    
  3. Verify the features were installed
    servicemix> features list
     State        Name
    . . .
    [installed  ] web-core
    [installed  ] web
    . . .
    
  4. Verify the installed bundles were started
    servicemix> osgi list
    START LEVEL 100
       ID   State         Level  Name
    . . .
    [  29] [Active     ] [   50] Apache ServiceMix Bundles: jetty-6.1.12rc1 (6.1.0.12rc1_1)
    [  30] [Active     ] [   50] OPS4J Pax Web - Web Container (0.4.1)
    [  31] [Active     ] [   50] OPS4J Pax Web - Jsp Support (0.4.1)
    [  32] [Active     ] [   50] OPS4J Pax Web Extender - WAR (0.3.0)
    [  33] [Active     ] [   50] OPS4J Pax Web Extender - Whiteboard (0.3.0)
    [  34] [Active     ] [   50] OPS4J Pax Url - war:, war-i: (0.3.2)
    [  35] [Active     ] [   50] Apache ServiceMix WAR Deployer (4.0.0.m2-SNAPSHOT)
    . . .
    
  5. The Jetty server should now be listening on http://localhost:8080/, but with no published applications available.
    HTTP ERROR: 404
    NOT_FOUND
    RequestURI=/
    Powered by jetty://
    

Deploying a WAR to the installed web feature

The following steps will describe how to install a simple WAR file (with JSPs or Servlets) to the just installed web feature.

  1. To deploy a WAR (JSP or Servlet) to Jetty, update its MANIFEST.MF to include the required OSGi headers as described here -
    http://wiki.ops4j.org/confluence/display/ops4j/Pax+Web+Extender+-+War+-+OSGi-fy
  2. Copy the updated WAR (archive or extracted files) to the deploy directory.


  • No labels