Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

org,apache.sling.servlet-helpers Bundle is missing in the AEM version 6.5.21 system console

Avatar

Level 1
Hi Team,
 
Initially, the code worked as expected without using the embed property, while running on AMS AEM 6.5 (exact service pack version unknown). We are using the org.apache.sling.servlet-helpers dependency, which is correctly declared in the pom.xml. However, we suddenly encountered an issue with the target sync functionality. Upon debugging, we discovered that the servlet-helpers JAR was missing. The JAR is not visible in the AEM console or listed among the active bundles. To resolve this, we applied the embed property to include the JAR under the /apps folder. Unfortunately, this workaround has led to Sonar issues related to the dependency. We are currently using AEM version 6.5.21
 
The servlet-helpers JAR is available in AEM as a Cloud Service, but it appears to be missing in AEM 6.5. We're unsure whether it was replaced or bundled within another JAR. Is it acceptable to manually install the JAR via the AEM console under bundles, or is there a recommended way to restore it? Additionally, is there an alternative approach to sync Experience Fragments (XF) to Adobe Target through code without using the dependency? 
 
Dependency:
-----------------------------
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.servlet-helpers</artifactId>
<version>2.0.0</version>
</dependency>
 
<embedded>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.servlet-helpers</artifactId>
<target>/apps/sample-bundles/install</target>
</embedded>
 
Code:
--------------------------------------
InternalRequest req;
req= new SlingInternalRequest(resourceResolver, slingProcessor,
                    withRequestMethod("POST").withParameter("path", xfPath).execute();
 
Sonar Issues:
The product interface org.apache.sling.api.request.RequestParameter annotated with @ProviderType should not be implemented by custom code. Detected in org.apache.sling.servlethelpers.MockRequestParameter contained in /apps/sample-bundles/install/org.apache.sling.servlet-helpers-1.4.6.jar.
The product interface org.apache.sling.api.request.RequestParameterMap annotated with @ProviderType should not be implemented by custom code. Detected in org.apache.sling.servlethelpers.MockRequestParameterMap contained in /apps/sample-bundles/install/org.apache.sling.servlet-helpers-1.4.6.jar.
 
Can you please help me on this to resolve the sonar issue or to update the code or to update the JAR in system console.
 
Thanks in Advance.
 
Thanks,
Bhanu M.
9 Replies

Avatar

Level 10

hi @BhanuMa,

I've a few questions:

  • Are you possibly using classes intended for JUnit testing within your regular code? If so, you should replace them with classes from a different package or jar.
    <scope>test</scope>

    to the dependency and remove the embed, though.

  • From your Sonar message, the embedded jar version is 1.4.6, but your dependency declares 2.0.0. This discrepancy should be addressed. Have you noticed it?

  • Before embedding the jar, have you tried searching for the class you need through the depfinder? Have a look here
 

Avatar

Level 1

Hi @giuseppebag ,

 

Sorry its typo mistake, we are using 1.4.6 in pom.xml also. Just we were thinking if we upgrade the version does it resolve the sonar issues or not. 

Avatar

Level 10

IMHO, the best solution is to address the root cause by avoiding the embedding of the jar, if possible. As a last resort, you could instruct SonarQube to exclude embedded jars or generated classes from the analysis to suppress false positives.

 

Avatar

Level 1

@giuseppebag ,

If i remove the embed property the jar won't be available. Because of missing this dependency only we added the embedd property.

Avatar

Community Advisor

HI @BhanuMa ,

The version specified for org.apache.sling.servlet-helpers in your pom.xml is 2.0.0.
However, another dependency in your project is also referencing org.apache.sling.servlet-helpers version 1.4.6.
This is causing a dependency conflict, which may have been introduced during the AEM upgrade or could be coming from the uber jar.

One possible solution is to align the versions by explicitly setting org.apache.sling.servlet-helpers to 1.4.6 in your pom.xml.

 

 

-Tarun




Avatar

Level 1

Hi @TarunKumar ,

 

Sorry for typo mistake, we were using 1.4.6. Its present in all the places.

 

Thanks,

Bhanu M.

Avatar

Administrator

@BhanuMa Hey! Just wanted to see if this got resolved. If you solved it yourself, sharing your solution could really help others. And if one of the answers here helped you, marking it as accepted will guide future readers. Thanks!



Kautuk Sahni

Avatar

Level 1

Hi @kautuk_sahni ,

 

Its not resolved. Still waiting for solution

Avatar

Level 2

Hi @BhanuMa,

 

  • In AEM 6.5 (AMS), the org.apache.sling. The servlet-helpers bundle is not shipped out of the box. That’s why you don’t see it under System Console → Bundles.

  • In AEM as a Cloud Service, the bundle is included as part of the base SDK dependencies, so your code works there without embedding.

  • By embedding the JAR manually under /apps/.../install, Sonar is flagging issues because you’re bringing in classes that implement Sling’s @ProviderType interfaces (e.g.,). RequestParameterRequestParameterMap Those are not supposed to be implemented directly by application code.

  • Best fix (short term): Install the org.apache.sling.servlet-helpers bundle into AEM 6.5 via OSGi console instead of embedding.

  • Best fix (long term): Refactor away from SlingInternalRequest usage. Use either:

    • Standard RequestDispatcher/Sling API for intra-request handling, or

    • Adobe Target’s official integration APIs for XF sync.

This will:
✔ Remove Sonar issues (no provider-type violation).
✔ Keep your code portable between AEM 6.5 and AEMaaCS.
✔ Avoid future upgrade/maintenance headaches.


Actionable next step:

  • Try removing the embed from yours. pom.xml

  • Install the org.apache.sling.servlet-helpers bundle via the OSGi console on 6.5.21.

  • Confirm if the servlet-based Target sync works. If yes, proceed to refactor toward Target APIs for long-term stability.

------------------------------------------------------------------------------------------------------------------------------------------------

Options to fix or improve this

  1. Do not embed the JAR

    • Embedding OSGi bundles under /apps/.../install is not recommended—it can create version conflicts and Sonar issues (as you’ve seen).

    • Instead, install the required bundle as an OSGi dependency in AEM:

      • You can download the matching version, org.apache.sling.servlet-helpers, from the Apache Sling Maven Repo.

      • Then upload it via AEM Console → Bundles → Install/Update.

    • This avoids embedding and clears Sonar concerns, since the code won’t be packaged inside your project anymore.

  2. Upgrade to a supported AEM Service Pack

    • You mentioned you’re on 6.5.21.

    • Check the release notes—in some recent service packs, Adobe backported certain Sling bundles.

    • Upgrading to the latest 6.5 SP could include the missing dependency without needing a workaround.

  3. Alternative approach for Target sync

    • If the goal is to sync Experience Fragments to Target, you may not actually need SlingInternalRequest or servlet-helpers.

    • Adobe provides the Target Integration via IMS + Target API, which allows XF export. This can be done with a proper HTTP client (e.g., org.apache.http.client) instead of simulating a POST via SlingInternalRequest.

    • That way, you avoid dependency on org.apache.sling.servlet-helpers altogether.