Sunday, 27 July 2014

Instance does not start caused by Access is denied / Bad file descriptor


Namastey,

Sometimes the instance doesn't start up and you recieve following error :

*INFO* [FelixStartLevel] com.day.crx.persistence.tar.TarSet scanning index E:\adobe-cq.5.5.0\Author\crx-quickstart\.\repository\workspaces\crx.default\data_04935.tar id:4945 length:102764544 append:-1 1898032864

 *ERROR* [FelixStartLevel] org.apache.jackrabbit.core.RepositoryImpl Failed to initialize workspace 'crx.default' javax.jcr.RepositoryException: Cannot instantiate persistence manager com.day.crx.persistence.tar.TarPersistenceManager
at com.day.crx.core.CRXRepositoryImpl$CRXWorkspaceInfo.createPersistenceManager(CRXRepositoryImpl.java:1290)
..
        ...
Caused by: java.io.IOException: Access is denied
at java.io.RandomAccessFile.writeBytes(Native Method)
at java.io.RandomAccessFile.write(Unknown Source
... 59 more

*ERROR* [FelixStartLevel] org.apache.jackrabbit.core.RepositoryImpl Unable to start repository, forcing shutdown...

In Linux machine, you will get
Caused by: java.io.IOException: Bad file descriptor

Theis error stack is due to inconsistencies between index_*.tar and data_*.tar files.

Solution 

0/ Stop the instance.
1/ Go to path as per *INFO* e.g. repository\workspaces\crx.default\data_04935.tar
2/ Change the permission of data_xxx.tar file to read write. 
    a) In windows , just right click on the tar file and uncheck readonly.
    b) In Linux , use chmod command to set file permissions right again
3/ Delete the index_*.tar and locks file present in the folder.
4/ Open the workspace.xml add parameters in searchindex tag as following  to check ,fix consistency and rebuilding of indexes.

<SearchIndex class="com.day.crx.query.lucene.LuceneHandler">
    <param name="path" value="${wsp.home}/index"/>
    <param name="enableConsistencyCheck" value="true"/>
    <param name="forceConsistencyCheck" value="true"/>
    <param name="autoRepair" value="true"/>

</SearchIndex>

5/ Restart the instance and tail the logs.
6/ Once the issue is resolved remove the parameters added in step 4 so that the consistency check doesn't run on every start of instance.

Dhanywaad,

Sunday, 20 July 2014

Overriding jQuery version in cq

Namastey !!

Sometimes you need to override the default version of Jquery present in cq.
Steps to upgrade Jquery Version :
1/ Go to /etc/clientlibs/granite/jquery/source
CQ itself uses jquery , however it uses $CQ instead of $ as in standard jquery.
Overriding ofjquery is not suggested if you are intended to use CQ in portlet mode.


For this you can simply follow below steps to to override the jQuery version in CQ.


2/ Create a folder according to jquery version. e.g. "2.0.1"
3/ Downlaod and copy the source code of jquery to that folder.
4/ Open /etc/clientlibs/granite/jquery/js.txt
5/ In that file, replace the old jquery path to the new one

But overriding jquery version is not known to conflict as such, but still to avoid any issue proper testing must be done in development environment.

Dhanywaad,


Friday, 4 July 2014

Color Coding in CQ blueprint and livecopy relationship.

Namastey , 

Do you really wonder what's the exact message of color button you see in blueprint control center  ?

Color Codes of Blueprint Livecopy relationship.

This information is directly available on CQ instance as well,
You can go to "Blueprint Control Center" and click "Legend".

Dhanywaad, 

Basic Sling Model Exporter

/* Open a page which is having component /apps/project/components/page/page /content/project/en/jcr:content.model.json Don't miss...