Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

AssetDelivery service for Web-optimized image is null

Avatar

Level 3

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
//...
    @reference(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,

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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-opti... 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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-opti...