Solr 5.x integration with AEM 6.2 | Community
Skip to main content
Level 2
October 25, 2016
Solved

Solr 5.x integration with AEM 6.2

  • October 25, 2016
  • 7 replies
  • 3535 views

Hi, I'm trying to integrate solr 5.5 with AEM 6.2 but it does not seems to work as per the documentation given on adobe docs: https://docs.adobe.com/docs/en/aem/6-2/deploy/platform/queries-and-indexing.html. Moreover the documentation is relevant to integrate solr 4.x especially the commands to start solr in cloud mode. 

Even when i try to integrate solr 5.5 (by starting them independently & configuring them in Solr configuration) it neither picks up Solr zookeeper nor the cloud instance. Below is the error which i'm facing:

25.10.2016 18:39:26.582 *WARN* [aysnc-index-update-async] org.apache.jackrabbit.oak.plugins.index.solr.server.RemoteSolrServerProvider unable to initialize SolrCloud client for localhost:9983
java.io.IOException: the found SolrCloud server is not alive
    at org.apache.jackrabbit.oak.plugins.index.solr.server.RemoteSolrServerProvider.initializeWithCloudSolrServer(RemoteSolrServerProvider.java:148)
    at org.apache.jackrabbit.oak.plugins.index.solr.server.RemoteSolrServerProvider.getSolrServer(RemoteSolrServerProvider.java:57)
    at org.apache.jackrabbit.oak.plugins.index.solr.server.RemoteSolrServerProvider.getIndexingSolrServer(RemoteSolrServerProvider.java:80)
    at org.apache.jackrabbit.oak.plugins.index.solr.server.OakSolrServer.getServer(OakSolrServer.java:72)
    at org.apache.jackrabbit.oak.plugins.index.solr.server.OakSolrServer.request(OakSolrServer.java:53)
    at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:118)
    at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:116)
    at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:102)
    at org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexEditor.leave(SolrIndexEditor.java:121)
    at org.apache.jackrabbit.oak.spi.commit.ProgressNotificationEditor.leave(ProgressNotificationEditor.java:76)
    at org.apache.jackrabbit.oak.spi.commit.VisibleEditor.leave(VisibleEditor.java:63)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:130)
    at org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:161)
    at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:434)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:125)
    at org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:161)
    at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:434)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:125)
    at org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:161)
    at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:434)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:125)
    at org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:161)
    at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:434)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52)
    at org.apache.jackrabbit.oak.plugins.index.IndexUpdate.enter(IndexUpdate.java:153)
    at org.apache.jackrabbit.oak.spi.commit.VisibleEditor.enter(VisibleEditor.java:57)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:49)
    at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.updateIndex(AsyncIndexUpdate.java:508)
    at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.runWhenPermitted(AsyncIndexUpdate.java:437)
    at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.run(AsyncIndexUpdate.java:321)
    at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:118)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
25.10.2016 18:39:26.584 *WARN* [aysnc-index-update-async] org.apache.jackrabbit.oak.plugins.index.solr.server.RemoteSolrServerProvider unable to initialize Solr HTTP client for [http://localhost:8983/]
org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Expected mime type application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 </title>
</head>
<body>
<h2>HTTP ERROR: 404</h2>
<p>Problem accessing /admin/ping. Reason:
<pre>    Not Found</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

    at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:459)
    at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:199)
    at org.apache.solr.client.solrj.request.SolrPing.process(SolrPing.java:70)
    at org.apache.solr.client.solrj.SolrServer.ping(SolrServer.java:293)
    at org.apache.jackrabbit.oak.plugins.index.solr.server.RemoteSolrServerProvider.initializeWithExistingHttpServer(RemoteSolrServerProvider.java:98)
    at org.apache.jackrabbit.oak.plugins.index.solr.server.RemoteSolrServerProvider.getSolrServer(RemoteSolrServerProvider.java:65)
    at org.apache.jackrabbit.oak.plugins.index.solr.server.RemoteSolrServerProvider.getIndexingSolrServer(RemoteSolrServerProvider.java:80)
    at org.apache.jackrabbit.oak.plugins.index.solr.server.OakSolrServer.getServer(OakSolrServer.java:72)
    at org.apache.jackrabbit.oak.plugins.index.solr.server.OakSolrServer.request(OakSolrServer.java:53)
    at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:118)
    at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:116)
    at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:102)
    at org.apache.jackrabbit.oak.plugins.index.solr.index.SolrIndexEditor.leave(SolrIndexEditor.java:121)
    at org.apache.jackrabbit.oak.spi.commit.ProgressNotificationEditor.leave(ProgressNotificationEditor.java:76)
    at org.apache.jackrabbit.oak.spi.commit.VisibleEditor.leave(VisibleEditor.java:63)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:130)
    at org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:161)
    at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:434)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:125)
    at org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:161)
    at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:434)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:125)
    at org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:161)
    at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:434)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:125)
    at org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:161)
    at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:434)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52)
    at org.apache.jackrabbit.oak.plugins.index.IndexUpdate.enter(IndexUpdate.java:153)
    at org.apache.jackrabbit.oak.spi.commit.VisibleEditor.enter(VisibleEditor.java:57)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:49)
    at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.updateIndex(AsyncIndexUpdate.java:508)
    at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.runWhenPermitted(AsyncIndexUpdate.java:437)
    at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.run(AsyncIndexUpdate.java:321)
    at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:118)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

 

I've also attached the screenshot of the configuration in configMgr for Solr. Independently the solr instance is running up perfectly.

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 smacdonald2008

I answered a similiar question yesterday. Reason why the 6.2 code was not working onn 6.2 was because it used code that does not work on 6.3. I updated the code that gets a session  in the SolrSearchServiceImpl class to:

Map<String, Object> param = new HashMap<String, Object>();

param.put(ResourceResolverFactory.SUBSERVICE, "datasolr");

ResourceResolver resolver = null;

try {

  //Invoke the adaptTo method to create a Session used to create a QueryManager

    resolver = resolverFactory.getServiceResourceResolver(param);

   session = resolver.adaptTo(Session.class);

Now it works. We will update the artilce starting this week

7 replies

Level 3
May 24, 2017

Even I am facing the same issue. Did you found the fix?

Level 2
May 24, 2017

We had taken the approach, as mentioned in the document https://helpx.adobe.com/experience-manager/using/aem_solr.html. because it uses the SolrJ API so we also used up the same. Since we did not had enough timelines in our project to explore more on "Solr Remote Server" configuration, so we leveraged SolrJ which helped in all versions of Solr (5.x, 6.x)

anilkum
Level 4
June 12, 2017

Hi,

We are trying to integrate solr using https://helpx.adobe.com/experience-manager/using/aem_solr.html with AEM 6.3. We are able to integrate with AEM 6.2 but facing issues in 6.3. Any pointers?

Thanks,

Anil

New Member
June 14, 2017

In my configuration I had a SOLR server with a collection/core of oak.

In this case the collection name is oak

The solr path was http://127.0.0.1/solr/oak

The url that will resolve for /admin/ping is /solr/oak/admin/ping.

Hopefully that will help you with your SOLR Configs.

FYI this was with solr 5.0.0.

smacdonald2008
smacdonald2008Accepted solution
Level 10
June 14, 2017

I answered a similiar question yesterday. Reason why the 6.2 code was not working onn 6.2 was because it used code that does not work on 6.3. I updated the code that gets a session  in the SolrSearchServiceImpl class to:

Map<String, Object> param = new HashMap<String, Object>();

param.put(ResourceResolverFactory.SUBSERVICE, "datasolr");

ResourceResolver resolver = null;

try {

  //Invoke the adaptTo method to create a Session used to create a QueryManager

    resolver = resolverFactory.getServiceResourceResolver(param);

   session = resolver.adaptTo(Session.class);

Now it works. We will update the artilce starting this week

Adobe Employee
June 15, 2017

Hi,

when I looked at an integration with AEM and external SOLR, the versoin of Solr supported by AEM was 4.7.1 Best to check with daycare

This doesn't mean it will not work, only that the later versions of SOLR have not been tested.

Regards,

Opkar

azharu9843294
June 6, 2018

Thanks for providing the information on Apache SOLR. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work for you in the future as well.