AssetDelivery service for Web-optimized image is null | Community
Skip to main content
Level 3
October 12, 2023
Solved

AssetDelivery service for Web-optimized image is null

  • October 12, 2023
  • 1 reply
  • 709 views

Hi,

 

I am trying to use web-optimized image delivery with my custom component's sling model, following documentation here and here.

 

It makes use of the `AssetDelivery` service, which I was told to inject like either of these.

 

com.adobe.cq.wcm.spi.AssetDelivery //... @3214626(cardinality = ReferenceCardinality.OPTIONAL) private volatile AssetDelivery assetDelivery; //... @OSGiService(injectionStrategy = InjectionStrategy.OPTIONAL) private AssetDelivery assetDelivery;

 

But the problem is that `com.adobe.cq.wcm.spi.AssetDelivery` does not exist as a service per OSGi Manager Console, so the injected `assetDelivery` is always null.

 

I am using the latest AEMaaCS locally. Could it be that this service is only available when the project is deployed to the cloud environment? Otherwise, how to make that service available on my localhost so the injection works?

 

Thank you,

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 Mahedi_Sabuj

From Adobe Documentation

Why doesn’t the service work with the local SDK?

When using the AEM SDK on localhost, the image service isn’t available, and the image rendering falls back to using the Adaptive Image Servlet.

To use the web-optimized image delivery service, deploy the project to a AEMaaCS development environment to be able to test precisely how the image service behaves with the image service.


https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/web-optimized-image-delivery.html?lang=en#local-sdk 

1 reply

Mahedi_Sabuj
Community Advisor
Mahedi_SabujCommunity AdvisorAccepted solution
Community Advisor
October 12, 2023

From Adobe Documentation

Why doesn’t the service work with the local SDK?

When using the AEM SDK on localhost, the image service isn’t available, and the image rendering falls back to using the Adaptive Image Servlet.

To use the web-optimized image delivery service, deploy the project to a AEMaaCS development environment to be able to test precisely how the image service behaves with the image service.


https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/web-optimized-image-delivery.html?lang=en#local-sdk 

Mahedi Sabuj