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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM 6.5 Kafka Streams (org.apache.kafka) Package cannot be resolved

aem-enthusiast
Level 2
Level 2

Hi Members,

 

I am trying to integrate my local AEM 6.5 instance to a Kafka instance running on confluent cloud. I have written a servlet that uses Kafka Streams to connect to Kafka instance. Now when I am trying to deploy the servlet in my local AEM, the kafka packages are showing as 'cannot be resolved' in system console bundles. The dependency is added in pom file and maven code build runs fine with no issues. Any pointers or suggestions on how to resolve this?

himanshus181219_0-1594094039438.pnghimanshus181219_1-1594094149105.png

Thanks

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

6.5
1 Accepted Solution
ArpitVarshney
Correct answer by
Community Advisor
Community Advisor

Hi @aem-enthusiast 

After adding maven dependency, please verify the <Embed-Dependency> tag of maven-bundle-plugin [You can either include all the dependencies or you can configure to not include specific ones]. The scope attribute lets you configure which dependency jars you want to include based on their include scope. You should not include the dependencies which are only needed for compile and for the test.

Below is the example to add the kafka-streams & kafka-clients to the embed dependency in your core pom.xml.

 

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Embed-Dependency>*;
|kafka-streams
|kafka-clients
</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>

Regards,

Arpit Varshney 

View solution in original post

2 Replies
Albin_Issac
Community Advisor
Community Advisor

The external dependencies should be embedded  into the bundle, refer the following forum URL - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/maven-dependency-when-usin... with same type of request to resolve the issue

Regards

Albin I

www.albinsblog.com

ArpitVarshney
Correct answer by
Community Advisor
Community Advisor

Hi @aem-enthusiast 

After adding maven dependency, please verify the <Embed-Dependency> tag of maven-bundle-plugin [You can either include all the dependencies or you can configure to not include specific ones]. The scope attribute lets you configure which dependency jars you want to include based on their include scope. You should not include the dependencies which are only needed for compile and for the test.

Below is the example to add the kafka-streams & kafka-clients to the embed dependency in your core pom.xml.

 

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Embed-Dependency>*;
|kafka-streams
|kafka-clients
</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>

Regards,

Arpit Varshney 

View solution in original post