Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Solr 5.x integration with AEM 6.2

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

AEM_SOLR63.png

View solution in original post

7 Replies

Avatar

Level 3

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

Avatar

Level 2

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)

Avatar

Level 4

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

Avatar

Level 1

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.

Avatar

Correct answer by
Level 10

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

AEM_SOLR63.png

Avatar

Employee

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

Avatar

Level 1

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.