Featured Post

Applying Email Validation to a JavaFX TextField Using Binding

This example uses the same controller as in a previous post but adds a use case to support email validation.  A Commons Validator object is ...

Wednesday, March 28, 2012

Alfresco SDK 4.0 "Path does not chain with any of the trust anchors" Error

If you're using the Alfresco 4.0 SDK, stick to Java 6 so that the out-of-the-box certificates work.
FirstFoundationClient is a Java class included with the Alfresco 4.0 SDK.  The class adds a document to Company Home.  When I first ran this, I received the following error.

Exception in thread "main" org.alfresco.repo.search.impl.lucene.LuceneQueryParserException: 02280000
at org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:364)

...

Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:208)


SOLR is a new searching engine in Alfresco, deployed as a separate webapp.  It still uses the Lucene search syntax, but it requires an SSL connection between /solr and /alfresco or another client like a standalone app (FirstFoundationClient).  In a development environment, I use the host 'localhost' which is probably the source of my certificate problems.  However, generating a certificate for a PC with an auto-assigned hostname may not work.

One way around the SSL error is to use the old Lucene rather than Solr.  Lucene is still supported.  To do this, use the following property in Alfresco globals.  Note that if you are changing this on an already running version, you may have to clear out the old indexes to reinitialize.

#index.subsystem.name=solr
 index.subsystem.name=lucene

Another solution is to use Java 6.  My exception came from running with Java 7.  A downgrade solved everything, although I ran into a PermGen space exception shortly after.  Increasing the amount of PermGen space fixed this second problem.  Here is the configuration that I'm using.

Running Alfresco's FirstFoundationClient

This post may help other non-Alfresco applications.  If you've found this page and aren't running Alfresco, try downgrading to see if your problem goes away.  Remember to also recompile any Java 7-compiled classes.

No comments:

Post a Comment