Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Error: Solr Integration with AEM 6.4

Avatar

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mayanky56670501
Level 1

30-09-2018

I'm not able to integrate Solr 7.5 with AEM 6.4,

getting the following error:

Solr Package Error.PNG

I have tried with almost every version of Solr, but I am getting the same error again and again!

I am simply following this tutorial:

Adobe Experience Manager Help | Integrating SOLR with Adobe Experience Manager

But, in this tutorial, apache.felix.scr.annotations are used. I am just replacing these annotations with osgi annotations.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

03-10-2018

Here is the new article with R6 annotations working - along with a video.

Adobe Experience Manager Help | Integrating SOLR with Adobe Experience Manager 6.4

@Component

public class SolrSearchServiceImpl implements SolrSearchService

One difference here is we show new way of reading OSGi config values for this use case. This involves these annotations:

package com.adobe.aem.core;

import org.osgi.service.metatype.annotations.AttributeDefinition;

import org.osgi.service.metatype.annotations.AttributeType;

import org.osgi.service.metatype.annotations.ObjectClassDefinition;

@ObjectClassDefinition(name = "AEM Solr Search - Solr Configuration Service", description = "Service Configuration")

public @interface MySimpleService {

    

    @AttributeDefinition(name = "Protocol", defaultValue ="http", description = "Configuration value")

    String protocolValue();

   

   

    @AttributeDefinition(name = "Solr Server Name", defaultValue ="localhost", description = "Server name or IP address")

    String serverName();

   

    @AttributeDefinition(name = "Solr Server Port", defaultValue ="8983", description = "Server port")

    String serverPort();

   

    @AttributeDefinition(name = "Solr Core Name", defaultValue ="collection", description = "Core name in solr server")

    String serverCollection();

   

    @AttributeDefinition(name = "Content page path", defaultValue ="/content/we-retail", description = "Content page path from where solr has to index the pages")

    String serverPath();

    

}

Answers (20)

Answers (20)

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

01-10-2018

I will include a video too in the new article and show everything!

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

01-10-2018

The article you referenced is for AEM 6.2. I am gonig to test this on 6.4 and we will update the article. Updating the OSGi to R6 and the dependencies will be part of this updated article.

Avatar

Avatar
Validate 1
Level 1
azaquan
Level 1

Likes

0 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
azaquan
Level 1

Likes

0 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
azaquan
Level 1

15-11-2019

Do you think is there a chance you guys could update a more recent Solr version? That makes the big difference on this issues though. That would be really awesome 🙂

We are getting the same kind of problems when trying to do the same project on the article (sing archetype 22) and different Solr versions, higher than 7.1

Thanks,

Juan

Avatar

Avatar
Ignite 1
Level 1
Lucas_Reyes
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
View profile

Avatar
Ignite 1
Level 1
Lucas_Reyes
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
View profile
Lucas_Reyes
Level 1

11-07-2019

I ran into the same issue and I fixed it by manually installing the bundle in Web Console from my local maven repository. After that, the bundle will resolve the dependency and the service can be activated.

Note that I'm using Solr 7.5 and tried both jars from org.apache.servicemix.bundles.solr-solrj and org.apache.solr.solr-solrj, but installing org.apache.solr.solr-solrj failed with error: java.io.IOException: Bundle-SymbolicName header missing, cannot install bundle.

BTW, I hope someone can explain what the difference is, but org.apache.servicemix.bundles.solr-solrj jar is bigger in size than org.apache.solr.solr-solrj.

Regards,

Lucas

Avatar

Avatar
Validate 1
Level 2
ajinkayk6258253
Level 2

Likes

10 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
ajinkayk6258253
Level 2

Likes

10 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
ajinkayk6258253
Level 2

10-07-2019

i'm also getting same issue whie interating with solr 8.1

Avatar

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mayanky56670501
Level 1

01-10-2018

Please use OSGi Annotations in that article!

and Thank you so much for your help!

Avatar

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mayanky56670501
Level 1

01-10-2018

Okay, I have tried to replicate this project, But I don't know why my OSGi bundle is not getting resolved! It is getting installed!

but again the same error is coming!

Capture.PNG

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

01-10-2018

I keep Felix Annotations for now - my main concern was getting the code to work in AEM 6.4. I am writing up the article now.

Avatar

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mayanky56670501
Level 1

01-10-2018

Are you using OSGI Annotations? and can you please send me the SOLR dependencies which you've used in this project.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

01-10-2018

The component also displays data from SOLR IN 6.4 --

Component.png

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

01-10-2018

I have AEM 6.4 and SOLR working. The Index was successful. We used We Retail too for AEM 6.4.

We will update this AEM SOLR article for AEM 6.4.

ClientQuery.png

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

01-10-2018

This will be part of the new article - need to test front end logic now.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

01-10-2018

I got the bundle into Active State on 6.4.

OSGi.png

Avatar

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mayanky56670501
Level 1

01-10-2018

Yes, I have tried this dependency. But my bundle is not getting installed and I am getting the same error: cannot be resolved

Avatar

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mayanky56670501
Level 1

01-10-2018

Sure, Thanks by the way.

Just one small request, Could you please update it as soon as possible!

Avatar

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

132 likes

Total Posts

540 posts

Correct Reply

164 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

132 likes

Total Posts

540 posts

Correct Reply

164 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile
PuzanovsP
MVP

01-10-2018

Dear Mayanky,

Please find patch that updates SolrJ library to 7.5.0. This code stil uses SCR, only the changes needed to update SolrJ library bundled here to 7.5 have been performed.

Index: core/pom.xml

IDEA additional info:

Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP

<+>UTF-8

===================================================================

--- core/pom.xml    (revision 603009da7fcd67f2b6ae3782edfbd0bb9a98153e)

+++ core/pom.xml    (date 1538407473120)

@@ -135,8 +135,13 @@

         </dependency>

         <!-- Solr Dependencies -->

         <dependency>

-            <groupId>org.apache.servicemix.bundles</groupId>

-            <artifactId>org.apache.servicemix.bundles.solr-solrj</artifactId>

+            <groupId>org.apache.solr</groupId>

+            <artifactId>solr-solrj</artifactId>

+        </dependency>

+        <dependency>

+            <groupId>org.apache.commons</groupId>

+            <artifactId>commons-math3</artifactId>

+            <version>3.6</version>

         </dependency>

         <dependency>

             <groupId>org.apache.commons</groupId>

Index: core/src/main/java/com/adobe/aem/core/servlets/IndexContentToSolr.java

IDEA additional info:

Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP

<+>UTF-8

===================================================================

--- core/src/main/java/com/adobe/aem/core/servlets/IndexContentToSolr.java    (revision 603009da7fcd67f2b6ae3782edfbd0bb9a98153e)

+++ core/src/main/java/com/adobe/aem/core/servlets/IndexContentToSolr.java    (date 1538407326651)

@@ -68,7 +68,8 @@

                 .getContentPagePath();

         String URL = protocol + "://" + serverName + ":" + serverPort

                 + "/solr/" + coreName;

-        HttpSolrClient server = new HttpSolrClient(URL);

+        final HttpSolrClient.Builder builder = new HttpSolrClient.Builder().withBaseSolrUrl(URL);

+        final HttpSolrClient server = builder.build();

         if (indexType.equalsIgnoreCase("indexpages")) {

             try {

                 JSONArray indexPageData = solrSearchService.crawlContent(

Index: core/src/main/java/com/adobe/aem/core/servlets/DeleteIndexesFromSolr.java

IDEA additional info:

Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP

<+>UTF-8

===================================================================

--- core/src/main/java/com/adobe/aem/core/servlets/DeleteIndexesFromSolr.java    (revision 603009da7fcd67f2b6ae3782edfbd0bb9a98153e)

+++ core/src/main/java/com/adobe/aem/core/servlets/DeleteIndexesFromSolr.java    (date 1538407326664)

@@ -41,7 +41,8 @@

         final String coreName = solrConfigurationService.getSolrCoreName();

         String URL = protocol + "://" + serverName + ":" + serverPort

                 + "/solr/" + coreName;

-        HttpSolrClient server = new HttpSolrClient(URL);

+        final HttpSolrClient.Builder builder = new HttpSolrClient.Builder().withBaseSolrUrl(URL);

+        final HttpSolrClient server = builder.build();

         try {

             server.deleteByQuery("*:*");

             server.commit();

Index: pom.xml

IDEA additional info:

Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP

<+>UTF-8

===================================================================

--- pom.xml    (revision 603009da7fcd67f2b6ae3782edfbd0bb9a98153e)

+++ pom.xml    (date 1538407046640)

@@ -486,12 +486,13 @@

                 <version>1.4</version>

                 <scope>test</scope>

             </dependency>

+            <!-- https://mvnrepository.com/artifact/org.apache.solr/solr-solrj -->

             <dependency>

-                <groupId>org.apache.servicemix.bundles</groupId>

-                <artifactId>org.apache.servicemix.bundles.solr-solrj</artifactId>

-                <version>5.4.1_1</version>

-            </dependency>

-            <dependency>

+                <groupId>org.apache.solr</groupId>

+                <artifactId>solr-solrj</artifactId>

+                <version>7.5.0</version>

+            </dependency>

+            <dependency>

                 <groupId>org.apache.commons</groupId>

                 <artifactId>commons-lang3</artifactId>

                 <version>3.3.2</version>

Regards,

Peter

Avatar

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

132 likes

Total Posts

540 posts

Correct Reply

164 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

132 likes

Total Posts

540 posts

Correct Reply

164 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile
PuzanovsP
MVP

01-10-2018

Hi Mayanky,

If you simply follow this tutorial and install the package with SCR annotations, it does work even on AEM 6.4 SP2.

At least to the point where you can see the bundle started. Following services are registered as well:

Service ID 8543Types: com.adobe.aem.core.SolrServerConfiguration
Service PID: com.adobe.aem.core.impl.SolrServerConfigurationImpl
Component Name: com.adobe.aem.core.impl.SolrServerConfigurationImpl
Component ID: 4256
Vendor: Adobe
Service ID 8544Types: javax.servlet.Servlet
Service PID: com.adobe.aem.core.servlets.DeleteIndexesFromSolr
Component Name: com.adobe.aem.core.servlets.DeleteIndexesFromSolr
Component ID: 4257
Vendor: Adobe
Service ID 8545Types: org.apache.sling.spi.resource.provider.ResourceProvider
Description: ServletResourceProvider for Servlets at [/bin/solr/delete/all/indexes, /bin/solr/delete/all/indexes.servlet]
Service ID 8546Types: org.apache.sling.spi.resource.provider.ResourceProvider
Description: ServletResourceProvider for Servlets at [/bin/solr/delete/all/indexes, /bin/solr/delete/all/indexes.servlet]
Service ID 8547Types: com.adobe.aem.core.SolrSearchService
Service PID: com.adobe.aem.core.impl.SolrSearchServiceImpl
Component Name: com.adobe.aem.core.impl.SolrSearchServiceImpl
Component ID: 4259
Vendor: Adobe
Service ID 8548Types: javax.servlet.Servlet
Service PID: com.adobe.aem.core.servlets.IndexContentToSolr
Component Name: com.adobe.aem.core.servlets.IndexContentToSolr
Component ID: 4258
Vendor: Adobe
Service ID 8549Types: org.apache.sling.spi.resource.provider.ResourceProvider
Description: ServletResourceProvider for Servlets at [/bin/solr/push/pages.servlet, /bin/solr/push/pages]
Service ID 8550

Types: org.apache.sling.spi.resource.provider.ResourceProvider
Description: ServletResourceProvider for Servlets at [/bin/solr/push/pages.servlet, /bin/solr/push/pages]


The tutorial itself uses Solr version 5.4.1. It adds Solr jar as a jar in class path:

Bundle Classpath.,OSGI-INF/lib/org.apache.servicemix.bundles.solr-solrj-5.4.1_1.jar,OSGI-INF/lib/log4j-1.2.16.jar,OSGI-INF/lib/noggit-0.5.jar,OSGI-INF/lib/zookeeper-3.4.5.jar

Which should allow you to work. So, in your case, to upgrade it to Solr 7, you would need to update your pom.xml to Solr 7 Jar's (including all of the new Jar's that need to be included in classpath for Solr 7).

Regards,

Peter

Avatar

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

440 likes

Total Posts

1,016 posts

Correct Reply

115 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

440 likes

Total Posts

1,016 posts

Correct Reply

115 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile
Veena_Vikram
MVP

01-10-2018

<dependency>
  <groupId>org.apache.solr</groupId>
  <artifactId>solr-solrj</artifactId>
  <version>7.5.0</version>
</dependency>

Is this the Maven dependency you are using ? I tried it but the jars are not reflecting in my build . Could you share the maven dependency you used. I can try it out and check

Thanks

Veena

Avatar

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
mayanky56670501
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mayanky56670501
Level 1

01-10-2018

bsloki​ I have checked almost every version of Solr from 5.0 -> 7.0 +, but nothing is working! Just getting the same error again and again!

Avatar

Avatar
Validate 25
MVP
bsloki
MVP

Likes

182 likes

Total Posts

1,859 posts

Correct Reply

545 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 50
Boost 5
View profile

Avatar
Validate 25
MVP
bsloki
MVP

Likes

182 likes

Total Posts

1,859 posts

Correct Reply

545 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 50
Boost 5
View profile
bsloki
MVP

01-10-2018

Please check the dependency version of solrj.

You can check the version by giving the package here - /system/console/depfinder