Split Apache OAK stores

Split Apache OAK stores


One of big projects drawbacks is a size of Apache OAK which is growing very fast due to big amount of assets , binary files, background processes which are care about repository data consistency, updates and so on. Of cause we can use compaction every week but there is exists another approach – split segment and blob store out of Tar files (which is an OOTB store implementation). One of the available option is to split NodeStore and BlobStore. More about BlobStore you can read here – click. Continue reading “Split Apache OAK stores”

Sling, Git, Windows and Filename too long

There is a common error on Windows systems when you are working with GIT – Filename too long:

error: unable to create file contrib/extensions/distribution/sample/src/main/resources/SLING-CONTENT/libs/sling/distribution/install.publish/impersonate-reverse/org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-impersonate-reverse.json: Filename too long

What does it means?

It means that by default GIT on Windows has a 260 characters limit due to system limitations (not all Windows apps are properly working with long file names). This can be critical if you will try for example will try to clone Sling application.


To remove this limitation we should open Windows Power Shell or CMD as administrator and execute command below:

git config --system core.longpaths true

This command will enable long path support and now we could maintain path up to 32,767 characters. For more information you can read this article.

How to simplify AEM UI developing

In AEM very often we need to synchronize content (html, css, dialogs, nodes and so on) between local AEM instance  and development environment. We can achieve this in a few ways:

  1. deploy content bundle every time when we need content refresh with maven (common approach)
  2. use some IDE with built-in functionality for synchronization (Eclipse with Sling IDE plugin, Brackets)

There is also exists another way which I’m referrer to synchronize content – to use Jackrabbit FileVault (VLT) which introduces a JCR repository to filesystem mapping.

Let me show in few steps how to configure it (I believe all console commands are self-explained): Continue reading “How to simplify AEM UI developing”

New Configuration Approach for AEM 6

Since OSGI R6 we can beautify old style configurations for AEM 6 and create more readable, maintainable and loosely coupled code. In this target Declarative Services 1.3 (DS 1.3)will assists to us. Let’s consider how this can be reached step by step in scope of AEM 6 and Java 8. I wouldn’t provide a long description with explanation all pros and cons of this approach, what Declarative Services is and other things. Anyway you can simply google it if it’s interesting for you. Continue reading “New Configuration Approach for AEM 6”

Lan connection is not working on Linux

Faced with Internet issue: we have a 1000 Mb Lan in office, PC motherboard Lan card supports 1000 Mb Lan but Lan wire was damaged / cut and works only on 100 Mb speed. Therefore after PC start Lan Card trying to connect on 1000 Mb speed but can’t and PC couldn’t connect to the Lan.

For successfully connection Lan Card should using 100 Mb speed. Therefore, until the repaired wire we can use this workaround (manually set Lan Card speed):

sudo ethtool -s eth0 speed 100 duplex full

This command will set adapter speed to 100 Mb. Of cause you should know your interface (in my case it was eth0) and connection type (in most cases full duplex enough). This configuration will be erased after reboot therefore if you need this options from start – put them to any start script.

Temviewer – no internet connection

Faced with an TeamViewer issue on Linux Mint 18 which I’m using as primary OS: after system start TeamViewer couldn’t connect to the internet and displaying in system tray exclamation mark and tool-tip that there is no internet connection. To fix it TeamViewer service had to be restarted with command below:

sudo teamviewer --daemon restart

this will restart TeamViewer service and also start TeamViewer client.


Create Adobe AEM project from scratch in 5 steps with Apache Maven

When newcomer starts to develop a new project the question arises in the rapid establishment of a skeleton for future application. Every AEM project other than “Hello World” should contains server-side business logic, environment specific configurations, page templates, component templates, unit and tests and so on. To keep all this code clean and maintainable we should group it into small pieces (modules). The best practice is to hold Java classes and other content separately. Here we come to the aid of the Apache Maven. Continue reading “Create Adobe AEM project from scratch in 5 steps with Apache Maven”

JCR-SQL2 Query with Examples


OOTB Apache OAK allow to create queries on SQL(deprecated), XPath(deprecated), JCR-JQOM and JCR-SQL2. It’s obvious that there is not a good point to explain deprecated SQL and XPath. This is a little How-To article which try to cower JCR-SQL2 queries for Apache Jackrabbit/OAK. Apache OAK has a more strict JCR-SQL2 syntax therefore some queries which are working correct on Apache Jackrabbit wouldn’t be executed on Apache OAK so we should always hold this in mind. Anyway let’s deal with JCR-SQL2 queries.
Continue reading “JCR-SQL2 Query with Examples”

How to make JSP scriplets on Java 7, Java 8 and above on Apache Sling and Adobe AEM

Sling implementation allow to render JSP with scriplets (of cause we using scriplets instead of Groovy console for hot-fixes). By default JSP compiler allow to write code compatible with Java 6 therefore if on server we has JVM version greater than 6 and desire to write code for recent JVM with additional benefits like Diamond operators from Java 7 or Lambdas and Streams from Java 8 we should configure JSP Scripts Handler to process required Java version otherwise we will see the compilation error: Continue reading “How to make JSP scriplets on Java 7, Java 8 and above on Apache Sling and Adobe AEM”

Linux: format USB to exFAT

To format USB flash card to exFAT file system we need this set of commands:

  1. sudo -i
  2. fdisk -l (this will provide mounted disk path, in my case it was /dev/sdc1)
  3. mkfs.exfat -n SOME_DISK_LABEL /dev/sdc1
  4. fsck.exfat /dev/sdc1 (this only need to be sure that disk was formatted w/o issues)