This post is applicable for AEM (adobe CQ).

As AEM provide couple of ways to preview your pages; but sometime business user require your actual preview like your end site with all redirects, re-write and vanity URL’s.

You can achieve in two ways as follows :

  1. Install a separate publish instance and use as stage environment. But this require to add a new instance into your infrastructure and it will cost also.
  2. Other way you can utilize your author instance by handling through apache virtualhost, rewrite and dispatcher configuration

I opt option #2 to implement my preview instance using below configuration

  • Create a readonly users in author instance and generate a authentication token and set into below configration.

<VirtualHost *:80>

ServerName <<previewsitename>>
DocumentRoot <<doctoot>>
DirectorySlash Off

RewriteEngine on
<Directory <<doctoot>>>
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
ModMimeUsePathInfo On
</IfModule>
AllowOverride none
</Directory>
SetEnvIf Remote_Addr “127\.0\.0\.1” localrequest
RequestHeader set Authorization “<<authorization tocken>>” env=!localrequest

# Handle request with slash
RewriteCond %{REQUEST_URI} !^/apps
RewriteCond %{REQUEST_URI} !^/bin
RewriteCond %{REQUEST_URI} !^/etc
RewriteCond %{REQUEST_URI} !^/home
RewriteCond %{REQUEST_URI} !^/libs
RewriteCond %{REQUEST_URI} !^/tmp
RewriteCond %{REQUEST_URI} !^/var
RewriteCond %{REQUEST_URI} !^/etc/designs/<<yourdesign>>
RewriteCond %{REQUEST_URI} !^/content
RewriteCond     %{REQUEST_URI} .*/$
RewriteCond     %{REQUEST_URI} !^/$
RewriteRule (.*)/$ $1 [R=301,NE,QSA]

RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)\.html$ $1 [R=301,NE,QSA]

# Handle requests no extension
RewriteCond %{REQUEST_URI} !^/apps
RewriteCond %{REQUEST_URI} !^/bin
RewriteCond %{REQUEST_URI} !^/etc
RewriteCond %{REQUEST_URI} !^/home
RewriteCond %{REQUEST_URI} !^/libs
RewriteCond %{REQUEST_URI} !^/tmp
RewriteCond %{REQUEST_URI} !^/var
RewriteCond %{REQUEST_URI} !^/etc/designs/<<yourdesign>>
RewriteCond %{REQUEST_URI} !^/content
RewriteCond %{REQUEST_URI} !.*\..*$
RewriteCond %{REQUEST_URI} !.*/$
RewriteRule ^/(.*)$ /content/<<sitename>>/$1.html?wcmmode=disabled [PT,L,QSA]

RewriteCond %{REQUEST_URI} !^/apps
RewriteCond %{REQUEST_URI} !^/bin
RewriteCond %{REQUEST_URI} !^/content
RewriteCond %{REQUEST_URI} !^/etc
#RewriteCond %{REQUEST_URI} !^/home
RewriteCond %{REQUEST_URI} !^/libs
RewriteCond %{REQUEST_URI} !^/tmp
RewriteCond %{REQUEST_URI} !^/var
RewriteCond %{REQUEST_URI} !^/etc/designs/<<yourdesign>>
RewriteRule ^/(.*)$ /content/<<sitename>>/$1?wcmmode=disabled [PT,NE,L]
RewriteCond %{REQUEST_METHOD} GET
RewriteRule ^/content/<<sitename>>/(.*)$ /$1 [R=301,NC,NE,L]

</VirtualHost>

if above configuration looks complex; please find easiest URL rewrite setting

First add in request header
Header add SM_USER “aempreview”
RequestHeader set SM_USER “aempreview”

Second updated the rewrite condition

RewriteRule ^/content(.*)\.html$ /content$1\.html?wcmmode=disabled [PT,L]

Hope this helps !

Posted on by askxperts | Leave a comment

This issue occurred while starting AEM server (Author/Publish). its throwing below error in stdout.log

org.osgi.framework.BundleException: Uncaught Instantiation Issue: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

08.10.2015 05:07:24.143 *ERROR* [main] at org.apache.sling.launchpad.base.impl.Sling.<init>(Sling.java:236)

08.10.2015 05:07:24.143 *ERROR* [main] at org.apache.sling.launchpad.base.app.MainDelegate$1.<init>(MainDelegate.java:183)

08.10.2015 05:07:24.143 *ERROR* [main] at org.apache.sling.launchpad.base.app.MainDelegate.start(MainDelegate.java:183)

08.10.2015 05:07:24.143 *ERROR* [main] at org.apache.sling.launchpad.app.Main.doStart(Main.java:409)

08.10.2015 05:07:24.143 *ERROR* [main] at org.apache.sling.launchpad.app.Main.doStart(Main.java:345)

08.10.2015 05:07:24.143 *ERROR* [main] at org.apache.sling.launchpad.app.Main.main(Main.java:135)

08.10.2015 05:07:24.143 *ERROR* [main] Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

08.10.2015 05:07:24.143 *ERROR* [main] at java.lang.String.<init>(Unknown Source)

08.10.2015 05:07:24.143 *ERROR* [main] at org.apache.sling.launchpad.base.impl.StartupManager.detectMode(StartupManager.java:132)

08.10.2015 05:07:24.143 *ERROR* [main] at org.apache.sling.launchpad.base.impl.StartupManager.<init>(StartupManager.java:79)

08.10.2015 05:07:24.143 *ERROR* [main] at org.apache.sling.launchpad.base.impl.Sling.<init>(Sling.java:210)

08.10.2015 05:07:24.143 *ERROR* [main] … 5 more

08.10.2015 05:07:24.144 *ERROR* [main] Cannot launch: Launcher.start() returned false

08.10.2015 05:07:24.144 *ERROR* [main] Failed to start Sling; terminating

Few quick checklist, before you jump into solution,

  • Is this is a fresh instance you are trying to build ?
  • Was the Java upgraded recently ?
  • Check out [1] to see if all technical requirements(OS, JVM etc.) are sufficient to start the instance.
  • If this issue persists, try downgrading JAVA and see if this helps resolve the issue.

if above questions are not valid for your issue, please follow below steps:

  • Go to your <installed-path>/crx-quickstart/launchpad/conf
  • Look for “launchpad-timestamp.txt”
  • move this “launchpad-timestamp.txt” file to any other location
  • restart your instance <installed-path>/crx-quickstart/bin/start
Posted on by askxperts | Leave a comment

Oak Lucene Index Defination Generator

You can generate Oak lucene index definition by providing query. This is really helpful
Oak index defination generator

 

Posted in Content Management | Leave a comment

Segment not found Oak error

This page has been moved to https://udaycorp.com/segment-not-found-oak-error/

Posted in AEM (Adobe Experience Manager), Content Management | Leave a comment

Possible reason is missing Repository service. Check AuthenticationSupport dependencies

Symptoms : After restart, users were not able to login in author and it seems admin password in Console started taking admin:admin default. All login attempts giving error like:
org.apache.sling.engine.impl.SlingHttpContext handleSecurity: Possible reason is missing Repository service. Check AuthenticationSupport dependencies.
if you execute oak-run checkpoint repository command and if this throw segment not found error.

Due to Online compaction on in AEM by default is corrupts Segments sometime when restarted server:

Solution: Permanently switch off online compaction from here, go to following node in crxde-
– /libs/granite/operations/config/maintenance/granite:daily/granite:RevisionGC
– And update the value of runmode to ‘crx3-disabled’ from ‘crx3’
If it gets curropted we can follwing these steps to get this up:

It seems that there is an inconsistency in your segment store. You would need to run below steps to find the last good revision and revert back to it.

1) Using a version of oak-run (oak-run-1.1.7.jar), which has the new check run-mode https://github.com/apache/jackrabbit-oak/blob/trunk/oak-run/README.md#check
This helps checking the segment node store inconsistencies.

2) To revert a corrupt segment store to its latest good state change into CQ’s working directory (the one containing the crx-quickstartfolder) and and backup all files in ./crx-quickstart/repository/segmentstore/.

3) Now run the consistency check,

java -Dtar.memoryMapped=true -Xms8g -Xmx8g -jar <path to oak run>/help/oak-run-1.1.7.jar  check -d1 -p <path to aem repo>/crx-quickstart/repository/segmentstore

which will search backwards through the revisions until it finds a consistent one:
Look for message like below

Apache Jackrabbit Oak 1.1.7
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Searching for last good revision in journal.log
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Checking revision bd57b402-6579-4f00-a9b7-24b30a954db0:261492
[main] ERROR o.a.j.o.p.segment.SegmentTracker – Segment not found: 00000000-0000-0000-0000-000000000000. Creation date delta is 33 ms.
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Error while traversing bd57b402-6579-4f00-a9b7-24b30a954db0:261492
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Broken revision bd57b402-6579-4f00-a9b7-24b30a954db0:261492
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Checking revision 12b60e9c-ecb9-45ae-a863-2ba1f467bb53:261684
….
….
[main] INFO  o.a.j.o.p.s.f.t.ConsistencyChecker – Found latest good revision 12b60e9c-ecb9-45ae-a863-2ba1f467bb53:261684

4) Revert the repository to this revision by editing ./crx-quickstart/repository/segmentstore/journal.log and deleting all lines after the line containing the latest good revision.
I.e. after 12b60e9c-ecb9-45ae-a863-2ba1f467bb53:261684 The bad one (which is bd57b402-6579-4f00-a9b7-24b30a954db0:261492)

5)Save journal.log file.
6) Delete the file ‘repo.lock’ and restart server.

As best practice we should do an offline compaction to get server run fine after these steps.

Posted in AEM (Adobe Experience Manager), Content Management | Leave a comment

AEM Repository is growing rapidly

Check your write operation on your instance. commonly its happens due to linkchecker utility. On publish instances, link checker is known to lead to disk space growth, and therefore suggested to be disabled. It doesn’t have any side effect since it’s not required on publish instances.

To disable this, first check the existing values of (a) & (b) and modify as per below:

a.	http://localhost:4503/system/console/configMgr/com.day.cq.rewriter.linkchecker.impl.LinkCheckerTransformerFactory
b.	http://localhost:4503/system/console/configMgr/com.day.cq.rewriter.linkchecker.impl.LinkInfoStorageImpl

In (a), “Disable Checking” should be checked. In (b), “Save external link references” should be unchecked.
We need to clean up existing entries from “/var/linkchecker” as well, it’s documented at [2].

These changes can be done in a rotating manner (bounce one publish’ apache/iis server at a time from the end users to clean up and make this configuration change).

For reference purpose, these changes are documented at article [1] & [2] combined.
Please validate and let us know if the disk space growth returns to normal after above configuration changes.

[1] https://helpx.adobe.com/experience-manager/kb/prevent-rapid-repository-growth-caused-by-linkchecker-in-aem-6.html
[2] https://helpx.adobe.com/experience-manager/kb/DisableLinkChecker.html (Refer the last Section on page)

Note : “Save external link references”, it will not available with SP1. It was actually introduced and fixed with Service Pack 2 which was released in February.
Currently, I would recommend that it would be better to directly move to SP3 (skipping sp2) released recently which is an important & recommended update, refer [1] [2]. On a side note, it brings in Oak 1.0.22 inbuilt.

Posted in AEM (Adobe Experience Manager), Content Management, Publish | Leave a comment

Please refer adobe guide lines TakeThreadDump

 

Posted on by askxperts | Leave a comment

To clearing stale workflows, please follow below steps:

  1. Open system console (http://aemserver:port/system/console)
  1. Stop the following bundles
  • Adobe Granite Replication (com.day.cq.cq-replication)
  • Apache Sling Event Support (org.apache.sling.event)Open crx de
  1. Go to /etc/workflow/instances, clear everything under this folder. Yon can also move /etc/workflow/instances under /tmp and then create a new /etc/workflow/instances folder with the exact same properties of the original /etc/workflow/instances
  1. Go to /var/eventing/jobs and delete all the content under it.
  1. Go to /var/replication/data and elete all the content under it.
  1. Start the bundles you stopped in step 2.
  1. Now try performing the job you were doing and see if it works or not.
Posted on by askxperts | Leave a comment

Software Development with Agile Kanban

As we understand, companies want development to be predictable: to know the exact state what work will be done and when it will be completed. To make such predictions, mechanisms must be in place to determine prioritization, workflow and lead time to delivery.
Agile Kanban takes organization’s current development process and provides greater visibility into the status of the work and how it is proceeding. Agile Kanban provides a method to continually adapt in order to smooth out kinks in the arrival of new development work. In this way, it allows the organization to avoid crises and respond more quickly and easily to issues that do arise.

 Agile Kanban gives more precise direction on how to invest development energy into only the most valuable work. The end outcome is a development pipeline that is predictably and efficiently delivering high value work.

The Agile Kanban Method reduces risk and increases flexibility, resulting in a more resilient development cycle.

The below are the some benefits that can be delivered by the Agile Kanban Methods –

  • Optimize Existing Processes – Introduction of visualization and the limiting of work-in-progress (WIP) will catalyze change with minimal disruption.
  • Deliver with Higher Quality – Limiting work-in-progress and defining policies for work prioritization will bring greater focus on quality. Policies can also address quality criteria directly.
  • Improve Lead Time Predictability – There is a correlation between the amount of work-in-progress, lead time and defect rates. Limiting WIP makes lead times dependable and keeps defect rates low.
  • Improve Employee Satisfaction – Agile Kanban reduces context switching and pulls work at the rate the team can complete it. Working at a more even, predictable pace, means employees are never overloaded.
  • Provide Slack to Enable Improvement – Creating slack in the value chain improves responsiveness to urgent requests and bandwidth to enable process improvement and quality improvement.
  • Simplify Prioritization – Agile Kanban enables fast reprioritization to accommodate changes in the market.
  • Provide a Transparency on the System Design and Operation – Improved visibility builds trust with customers and managers. It also shows the effects of actions or inactions. As a result, collaboration improves.
  • Enables Emergence of a “High-Maturity” Organization – As improvements are implemented, organizational maturity improves leading to better decision making and improved risk management. Risk, managed appropriately, brings predictable results.

The Agile Kanban method is defined on five set of principles as follows –

Visualize the Workflow Represent the work items and the workflow on a white board   or electronic dashboard.
Limit Work-in-Progress (WIP) Set agreed upon limits to how many work items are in   progress at a given time
Measure & Manage Flow Track work items to see if they are proceeding at a   steady, even pace
Make Process Policies Explicit Agree upon and post policies about how work will be delivered
Use Models to Evaluate Improvement Opportunities Adapt the process using ideas from Systems Thinking
Posted in Methodology | Leave a comment