I'm trying to follow this example from Adobe in a different way as mentioned below....
https://experienceleague.adobe.com/docs/experience-manager-65/developing/platform/access-jcr.html?lang=en
MY Code:
public class CreatingJcrNodes {
public static void main(String[] args) throws Exception {
try {
//Create a connection to the CQ repository running on local host
Repository repository = JcrUtils.getRepository("http://localhost:4502/crx/server");
//Create a Session
javax.jcr.Session session = repository.login( new SimpleCredentials("admin", "admin".toCharArray()));
//Create a node that represents the root node
Node root = session.getRootNode();
// Store content
Node adobe = root.addNode("adobe");
Node day = adobe.addNode("day");
day.setProperty("message", "Adobe CQ is part of the Adobe Digital Marketing Suite!");
// Retrieve content
Node node = root.getNode("adobe/day");
System.out.println(node.getPath());
System.out.println(node.getProperty("message").getString());
// Save the session changes and log out
session.save();
session.logout();
}
catch(Exception e){
e.printStackTrace();
}
}
}
Error : javax.jcr.RepositoryException: Unable to access a repository with the following settings:
I've found a number of articles both here and on other sites but none of the suggestions I've found have done anything to resolve the issue.