AEM/CQ5 AuthenticationSupport service missing

My computer crashed and on restart my local instance was not working property (blank pages). Looking at the error.log there was

org.apache.sling.engine.impl.SlingHttpContext handleSecurity: AuthenticationSupport service missing. Cannot authenticate request.

After a quick look at the felix console and having seen all the bundles up and running I went to reading backwards the error.log. I saw that during the start-up Lucene was failing to start and therefore the repository was not initialized correctly.

I managed to have my local instace back to work by having CQ fully regenerate my Lucene indexes.

See How to check and repair search index inconsistencies (Completely rebuild the index)

Advertisements

CQ5 “disable” linkcheker

Linkcheker it’s a very useful functionality that highlight to the author eventual broken links within, for example, a RichText widget. However when integrating already existent web application behind apache, there’s the need to “disable” completely it.

We won’t go to disable it properly but configuring it in a way that for him all links are not to be checked.

In CQ5.4, go into the Felix console and click con components (http://$server:$port/system/console/components) and search for: com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl. Click on the wrench (settings) and in the link check override patterns add the following regex (using the “+” button):

^.*$

Save and refresh the page in the author.

This will save the settings into the file crx-quickstart/launchpad/config/com/day/cq/rewriter/linkchecker/impl/LinkCheckerImpl.config.

This will work, but it will disable the Apache Sling JCR Resource Resolver as well, as it uses the LinkChecker service behind the scenes to transform the links.

A more intelligent approach is to use a negative RegEx saying to LinkChecker to ignore everything that is not in our /content/sitename. Use this regular expression:

^((?!/content/sitename).)*$

Replacing sitename with your correct path.

If you want to set the config into the CRX repository (so it can be exported/imported via package manager)  go to /libs/cq/linkchecker/config/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl using Content Explorer and edit the property service.check_override_patterns adding the regex previously mentioned.

Easy peasy! 🙂

Weekly links 2010-32

During these weeks I was too busy for contributing the weekly link. Here it is one for this week 🙂

Maven is good, but needs some love

…But Maven needs a proper and clean environment…

Functional Programming Concepts in JDK 7 | Javalobby

Kent Beck’s Test Driven Development Screencasts

Following the recommendations of Corey Haines, Michael Guterl, James Martin and Michael Hunger I decided to get Kent Beck’s screencasts on Test Driven Development which have been published by the Pragmatic Programmers.

Testing REST Web Services With JPA and Spring

REST Web Services can be particularly difficult to test, with the need for networking, a web container, multiple threads and transaction management creating extra complexity beyond your standard unit test. In this article I demonstrate patterns designed to address this complexity while enabling complete testing of your REST web service stack.

Oracle shuts down open source test servers

No One Nos: Learning to Say No to Bad Ideas

No. One word, a complete sentence. We all learned to say it around our first birthday, so why do we have such a hard time saying it now when it comes to our work?

Kick Ass Kickoff Meetings

Every meeting is an opportunity. Why waste your first one?

5 things you didn’t know about … Java Database Connectivity

JDBC is more than a background player in database connectivity. The more you know about it, the more efficient your RDBMS interactions will be.

Have you upgraded your Java 1.6_21 to Java 1.6_21?

Selenium 2/Web Driver – the land where Page Objects are king!

12 Things A Programmer Really Needs To Know

URL-based Locale

Spring Reading – Getting Started with Spring Framework

Weekly links 2010-29

The Passage of Time by ToniVCCommons Configuration

Commons Configuration provides a generic configuration interface which enables a Java application to read configuration data from a variety of sources.

Lambdas in Java Preview – Part 1: The Basics | Javalobby

…closures (or better lambda expressions) will (probably) be added to JDK7..

Lambdas in Java Preview – Part 2: Functional Java | Javalobby

…giving some practical examples of lambdas, how functional programming in Java could look like and how lambdas could affect some of the well known libraries in Java land…

Lambdas in Java Preview – Part 3: Collections API

In this part I’ll focus on how the addition of lambdas could affect one of the most used standard APIs – the Collections API.

First Symbian^4 Screenshots Surface

for those interested in, there are some previews of the 4th version of Symbian OS

Life is Too Short to Parse Command Line Parameters

Recently, DZone MVB Cedric Beust unveiled JCommander, a tool he developed that takes away the manual labor of command line parsing.  Just six days after posting his announcement for JCommander 1.0, he’s already got an expanded 1.1 version out.  New features include simple internationalization, type converters, and password parameters.

OutOfMemoryError in Eclipse with JDK 1.6.0_21, on Windows

This past weekend I spent a good amount of time trying to solve an OutOfMemoryError that made Eclipse crash every 5 minutes.

Sun Java 6 on Ubuntu 10.04 10.10 and later

Apparently the Ubuntu folks have started putting some weight behind their recommendations for switching to the “OpenJDK.” Fortunately, the official, “proprietary” Java is still available through another Ubuntu repository.

Effective JSON with Google Web Toolkit

Hopefully every developer knows JSON protocol or has at least heard about it. In Google Web Toolkit technology, JSON is a very common protocol