Hello,
I am attempting to connect to a remote JCR instance (specifically an
instance related to Adobe's AEM solution, using this guide:
https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/access-jcr.html?lang=en
)
This is a sample code snippet of how I am connecting:

    public static void main(String[] args) throws RepositoryException {
        javax.jcr.Repository repository = JcrUtils
                .getRepository("https://example.com/crx/server";);

        // Create a Session instance
        var session = repository
                .login(new SimpleCredentials("user", "user".toCharArray()));
        var root = session.getRootNode();
        var nIter = root.getNodes();
        while (nIter.hasNext()) {
            var n = (Node) nIter.next();
            System.out.println(n.getPath());
        }

However, the "iteration" portion is given an error: Workspace
mismatch: 'https://example.com:443/crx/server/crx.default/jcr%3aroot/bin'
not under workspace 'https://example.com/crx/server/crx.default'
(position 41: '{https:/example.com}:443/crx/server/crx.default/jcr%3aroot/bin',
expected: '/crx/server/crx.default')

>From the error (and confirmed by debugging), I can see that the
mismatch is occurring because of the port (443) being include in the URI
 but not the workspace (the position 41 in the error is inaccurate
simply because since I have removed the actual domain).

However, I am a bit perplexed as to why it is including the port.
Obviously, I am not specifying the port when connecting and I am using the
standard https port, so I am not sure how I can resolve this issue ?

Reply via email to