Error on connecting to JCR using JcrUtils.getRepository (on SSL enabled environment) | Community
Skip to main content
yagyesh11235
Level 2
December 31, 2015
Solved

Error on connecting to JCR using JcrUtils.getRepository (on SSL enabled environment)

  • December 31, 2015
  • 11 replies
  • 8512 views

Hi ,

I am trying to access repository from external java application using JcrUtils.

repository = JcrUtils.getRepository("https://localhost:7502/crx/server"); this works
repository = JcrUtils.getRepository("https://localhost:5433/crx/server"); this doesn't work exceptions: javax.jcr.RepositoryException: Unable to access a repository with the following settings:     org.apache.jackrabbit.repository.uri: epository.login The following RepositoryFactory classes were consulted:     org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined     org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined     org.apache.jackrabbit.commons.JndiRepositoryFactory: declined     org.apache.jackrabbit.core.RepositoryFactoryImpl: declined     org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory: failed         because of IllegalArgumentException: URI is not absolute Perhaps the repository you are trying to access is not available at the moment.         at org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:204)         at org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:244)       Thanks in advance
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by GK-007

These jars are not enough to connect to JCR standalone.

Please refer below link for list of jars required.

http://experience-aem.blogspot.ch/2015/05/aem-6-sp2-accessing-crx-remotely-using-jcr-remoting-davex.html

11 replies

February 14, 2021

You need 

jackrabbit-standalone jar

 

and 

Jackrabbitjcr2dav jar

 Choose latest versions

October 26, 2023

The problem is that org.apache.jackrabbit:jackrabbit-jcr-commons and org.apache.jackrabbit:jackrabbit-jcr2dav have the same file META-INF/services/javax.jcr.RepositoryFactory, which contains the Factory, the correct one is org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory.
Below, this file was removed from jackrabbit-jcr-commons using shade plugin, to avoid conflict with jackrabbit-jcr2dav.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>org.apache.jackrabbit:jackrabbit-jcr-commons</artifact>
<excludes>
<exclude>META-INF/services/javax.jcr.RepositoryFactory</exclude>
</excludes>
</filter>
</filters>
<finalName>turing-aem</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>indexer</shadedClassifierName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>your.mainclass</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>