Exception while accessing AEM repository | Community
Skip to main content
Siva_Sogalapalli
Community Advisor
Community Advisor
October 16, 2015
Solved

Exception while accessing AEM repository

  • October 16, 2015
  • 4 replies
  • 2284 views

We have two AEM instances and trying to access one AEM instance repository on other AEM instance. 

I've created workflow process where I used below to code to access. But it is throwing below exception when the process is executed.

Piece of code: 

Repository repository = JcrUtils.getRepository("http://localhost:4502/crx/server");
//Create a Session
Session session = repository.login( new SimpleCredentials("admin", "admin".toCharArray()),"crx.default"); 

Exception: Unable to access a repository with the following settings:
org.apache.jackrabbit.repository.uri: localhost:4502/crx/server
The following RepositoryFactory classes were consulted:
Perhaps the repository you are trying to access is not available at the moment.

But the same code is working when I write Standalone java class to access AEM repository and it is not working only when I try to access AEM repository from other AEM server. Please advise if I'm missing anything. Quick response would be appreciated.

Thanks

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 ogill

Hi,

your error is "org.apache.jackrabbit.repository.uri: localhost:4502/crx/server" and are these two instances on the same server or separate servers? If you are using localhost I am guessing the same server.

If the same server, I would expect you to use 4502 for one and 4504 for the other(convention is to have even port numbers for author and odd for publish instances)

If you are running the code on the instance running on port 4502 you should be connecting to localhost:4504.

The servlet should be on the server running the workflow. But get your code calling correctly first.

The idea of the servlet is that it takes in a parameter, calculates whether a workflow contains the page as a package and returns a JSON response. 

Regards,

Opkar

4 replies

ogillAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

Hi,

your error is "org.apache.jackrabbit.repository.uri: localhost:4502/crx/server" and are these two instances on the same server or separate servers? If you are using localhost I am guessing the same server.

If the same server, I would expect you to use 4502 for one and 4504 for the other(convention is to have even port numbers for author and odd for publish instances)

If you are running the code on the instance running on port 4502 you should be connecting to localhost:4504.

The servlet should be on the server running the workflow. But get your code calling correctly first.

The idea of the servlet is that it takes in a parameter, calculates whether a workflow contains the page as a package and returns a JSON response. 

Regards,

Opkar

Siva_Sogalapalli
Community Advisor
Community Advisor
October 16, 2015

Opkar, Thank you very much for your time.

Siva_Sogalapalli
Community Advisor
Community Advisor
October 16, 2015

Hi Opkar,

Thank your for your reply.

I wanted to access the page information of other AEM server (Author) and check whether the page is associated with workflow or not. As you suggested I've created a AEM servlet to access the other AEM repository. But I'm getting same exception. 

Both servers are running on port 80. (To make sure, I've also tested with different ports.)

Please advise.

Adobe Employee
October 16, 2015

Hi,

what are you trying to achieve? Can you not just make a rest call and get the contents of a node? Or are you looking to update content. If you want to get some results and process the contents, perhaps considering making a servlet on the other server.

What ports are both your servers running on? 

Regards,

Opkar

January 10, 2024

@ogill  @siva_sogalapalli  I'm trying to invoke the crx server I'm also getting same error 
If i try in browser it working fine, could you please help me how to resolve this and if I search in google it suggesting to use jackrabbit-standalone-2.4.0 version and I'm not able to find this version in google.