Programatically access AEM Publish Server from Author AEM6.5
We have a requirement in our application where we are building an utility which will only run on AEM author environment. This will search for users by his/her email ID on both author and publish servers. For this we have to connect to publish servers from author environment. I am trying to do it by using the following piece of code on author environment,
final String repoUrl = "http://localhost:4503/crx/server";
final javax.jcr.Repository repository = JcrUtils.getRepository(repoUrl);
final Session session = repository.login(new javax.jcr.SimpleCredentials("admin", "admin".toCharArray()), "crx.default"); But I am getting error while doing JcrUtils.getRepository(repoUrl) as below,
Unable to access a repository with the following settings: org.apache.jackrabbit.repository.uri: http://localhost:4503/crx/server The following RepositoryFactory classes were consulted: Perhaps the repository you are trying to access is not available at the moment..
Any help is highly appreciated