Getting RepositoryException when accessing AEM app created in cloud server | Community
Skip to main content
Level 2
October 16, 2015
Solved

Getting RepositoryException when accessing AEM app created in cloud server

  • October 16, 2015
  • 2 replies
  • 1711 views

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.

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 JustinEd3

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

2 replies

JustinEd3Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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

smacdonald2008
Level 10
October 16, 2015

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