Friday, August 17, 2012

How to run Airavata with New Sling Registry API

Step 1 (Apply Patch)


Apply one of following patches to Airavata if it is not already added. 

Patch-1: Only adds Sling Registry API and updates dependencies. 
Patch-2: Adds Sling Registry API, updates dependencies and modifies all references.

Note: To run Airavata with new API, Patch 2 should be applied.  

Step 2 (Download Sling Launchpad)


Download Sling launchpad 7.0 from here. Or you can get source from here and build it yourself.

Now you have 3 options.
  1. Use Sling Launchpad with its internal Jackrabbit repository.
           - To do this, you can simply skip Step 3 and 5.
  2. Use a new external Jackrabbit repository.
           - To do this, you need to run a separate Jackrabbit server. Then, a Jackrabbit repository directory will be created. You can use this folder for next step. Make sure to stop the Jackrabbit server.
  3. Use an existing external Jackrabbit repository.
           - If you already have a Jackrabbit repository directory, you can use it for next step. 

Step 3 (Configure External Repository)


Go to external Jackrabbit repository directory. Modify its repository.xml by replacing its Security configuration element by following.

<Security appName="Jackrabbit">
     <SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" workspaceName="security">
     </SecurityManager>
     <AccessManager class="org.apache.sling.jcr.jackrabbit.server.impl.security.PluggableDefaultAccessManager">
     </AccessManager>
     <LoginModule class="org.apache.sling.jcr.jackrabbit.server.impl.security.PluggableDefaultLoginModule">
          <param name="anonymousId" value="anonymous"/>
          <param name="adminId" value="admin"/>
     </LoginModule>
</Security>


Step 4 (Start Sling Server)


Start Sling Launch pad in port 8081.

java -jar org.apache.sling.launchpad-7-standalone.jar -p 8081

Step 5 (Configure Sling Server)


  1. Go to http://localhost:8081/system/console/configMgr 
    • Give admin:admin as username:password if asked.
  2. Go to row Apache Sling Embedded JCR Repository
  3. Click on org.apache.sling.jcr.jackrabbit.server.SlingServerRepository.########
  4. Configure Configuration File, Repository Home and Repository Name as follows.
    • Configuration File: Jackrabbit Repository.xml path 
      • Eg. /home/.../jackrabbit/repository.xml
    • Repository Home: Jackrabbit home path
      • Eg. /home/.../jackrabbit/
    • Embedded JCR Repository Name: 'jackrabbit'
  5. Restart Launchpad

Step 6 (Start Airavata)


Now you can start Airavata server & XBaya, and continue.