Tuesday, June 26, 2012

Plugging an external Jackrabbit repository to Apache Sling Launchpad : Attempt 1

Apache Sling Launchpad has its own Jackrabbit repository embedded in it. But since Airavata has its own Jackrabbit repository, Sling Launchpad's embedded repository should be replaced by that of Airavata. According to a thread in Sling user mailinglist, I configured Launchpad.  


I did this twice with 2 versions of Sling Launchpad.

1) Sling Launchpad 6
2) Sling Launchpad 7


How to configure?

  1. Start Launchpad as mentioned in this tutorial
  2. Now go to http://localhost:8080/system/console/configMgr 
    • Give admin:admin as username:password if asked.
  3. Go to row Apache Sling Embedded JCR Repository
  4. Click on org.apache.sling.jcr.jackrabbit.server.SlingServerRepository.########
  5. 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'
  6. Restart Launchpad

Thursday, June 21, 2012

Task 1 completed: June 3rd week

I could solve the issue in task 1 with the help of devs in airavata. The problem was airavata-gfac-schema-utils.jar was not in the project class path. So I manually added the jar and code worked fine then. 

I implemented some general methods like addNode(), getNode(), deleteNode() so I can use them in almost all other methods to be implemented in new registry. I wrote some test cases as well.

I'm still having the issue in task 2. I asked this from Sling user list and they asked me to have a look in error log in Sling/log folder. In had a look and I could see some exceptions saying, "Invalid Namespace Index: #######". I told this to Sling user list and a dev said he has never faced this issue. And he further said the problem occurs in jackrabbit repository and asked me to ask this in Jackrabbit user list.

Before asking from Jackrabbit user list, I dug into jackrabbit user list archive but I couldn't find a relevant topic.  So now I should ask them about this issue.

I created a Google Code Project for my implementations. Here is the link.

That's all for now. :)

Wednesday, June 13, 2012

Midweek Update : 3rd Week of June

Task 1:


According to my last post, I started task 1 and implemented 'getServiceDescription()' method using Sling. I used a java.net.HttpURLConnection connection to communicate with Sling launchpad and org.json.JSONObject to parse the received JSON string. Everything works fine up to that point and I'm able to get Service Description in XML format. 

But when creating ServiceDescription object, I got following exception. I talked about this with my gsoc mentors and had their opinion. And now I'm working on it.

Exception in thread "main" java.lang.ExceptionInInitializerError         at org.apache.airavata.schemas.gfac.ServiceDescriptionDocument$Factory.newInstance (ServiceDescriptionDocument.java:45) at org.apache.airavata.commons.gfac.type.ServiceDescription.<init>(ServiceDescription.java:34) at org.apache.airavata.commons.gfac.type.ServiceDescription.fromXML(ServiceDescription.java:47)

Task 2:


So far I was working with dummy repository data which were stored in embedded jackrabbit repository of Sling launchpad and now I'm trying to plug a separate jackrabbit server so I can work with real data created through xbaya. According to a thread in Sling-user mailing list archive, I configured an external repository but I keep getting http 503 error with the following message, when I try to access the repository.

HTTP ERROR 503Problem accessing /content. Reason: AuthenticationSupport service missing. Cannot authenticate request.
Powered by Jetty://

I asked this from Sling-user mailing list and waiting for an reply. That's all for now. :)

Friday, June 8, 2012

Tasks for 3rd Week of June


Here is my plan for the 3rd week of June. After discussing with mentors, I decided to have 3 tasks for the week as follows.

Task 1:
Implement a Sling based class with selected important methods to have the functionality of AiravataJCRRegistry class, and test implemented functionality with Sling Launchpad with its inbuilt jackrabbit repository. 

Task 2:
Plug a separate jackrabbit repository to Sling Launchpad and test implemented functionality in task 1.

Task 3:
Try to use Sling Launchpad with its inbuilt Jackrabbit repository for user management tasks such as adding and deleting users. Do the same thing with Sling Launchpad with a separate jackrabbit repository. 

Thursday, June 7, 2012

Progress Update for the 1st Week of June


According to my project proposal, first thing to implement is the login procedure. So I studied login part of Airavata registry API by debugging the system and I think I have a good understanding about it now. 

In last 2 weeks I studied Apache Sling and Apache Jackrabbit, and I followed most of their tutorials well. I got some issues with samples in Sling Source and I sent several emails to their user and dev mailing lists. I had to wait several days for a response and finally I got one. Hopefully I will be able to keep contact with them. The good thing is Sling community was aware of my project even before I contacted them.

Apache Sling has something called Launchpad (a server), and it has its own jackrabbit repository. The tutorials are based on that. I was trying to plug a separate jackrabbit server instead of its in-built one, and I think it is possible. I'm trying to understand how to use this Launchpad for this project.

Friday, June 1, 2012

My Project in GSoC 2012


For GSoC 2012 I applied to a project which was named as 'Integrate Apache Sling to Apache Airavata Registry' and I was lucky enough to be selected for this project. The project proposal I submitted is published here.

As the project name implies the project is focused on Apache Airavata Registry API. What I have to do in the project is to integrate Apache Sling in to Apache Airavata Registry, so that Airavata Registry API can communicate with remote Content Repositories (in this case it is Apache Jackrabbit) in a RESTful way.