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.