Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Getting RepositoryException when accessing AEM app created in cloud server

Avatar

Level 2

Hi All,

 

I have just written sample java utility to get connection from AEM which is installed in cloud server.Below code snippet only i have used to get the session.Application is running in JBoss server.

Repository repObj = JcrUtils.getRepository("URL");

sessObj = repObj.login(new SimpleCredentials("user", "password".toCharArray()));

 

Below exception is being thrown.

javax.jcr.RepositoryException: Unable to access a repository with the following settings:
    org.apache.jackrabbit.repository.uri: <URL>
The following RepositoryFactory classes were consulted:
    org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
Perhaps the repository you are trying to access is not available at the moment.
    at org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:217)
    at org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:257)
    at com.sample.cqexamples.GetCRXSession.getCRXSession(GetCRXSession.java:19)
    at com.sample.cqexamples.GetCRXSession.main(GetCRXSession.java:33)
Exception in thread "main" java.lang.NullPointerException
    at com.sample.cqexamples.GetCRXSession.main(GetCRXSession.java:33)

 

To get connection from any standalone class ,do i need to change JBOss start up script?

Please help if anyone have encountered this kind of issues.

Thanks,

Kishore.

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi,

This part:

The following RepositoryFactory classes were consulted: org.apache.jackrabbit.commons.JndiRepositoryFactory: declined

Indicates that a JAR file (jackrabbit-jcr2dav) is missing from your classpath. See this old thread: https://forums.adobe.com/message/5162978

Regards,

Justin

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

Hi,

This part:

The following RepositoryFactory classes were consulted: org.apache.jackrabbit.commons.JndiRepositoryFactory: declined

Indicates that a JAR file (jackrabbit-jcr2dav) is missing from your classpath. See this old thread: https://forums.adobe.com/message/5162978

Regards,

Justin

Avatar

Level 10

This Exception suggests that your URL is wrong to AEM.

javax.jcr.RepositoryException: Unable to access a repository with the following settings:
    org.apache.jackrabbit.repository.uri: <URL>

Once AEM is running on a server - you can connect to it via the JCR API and specifying the correct URL. See:

http://helpx.adobe.com/experience-manager/using/integrating-custom-carousel-component-cq.html