AEM Cloud: NoClassDefFoundError when embedding Sejda WebP (com.luciad.imageio.webp) using bnd | Community
Skip to main content
Level 2
January 27, 2026
Question

AEM Cloud: NoClassDefFoundError when embedding Sejda WebP (com.luciad.imageio.webp) using bnd

  • January 27, 2026
  • 4 replies
  • 70 views

Hi everyone,

I'm working on AEM as a Cloud Service and trying to convert JPEG/PNG images to WebP using a DAM Workflow (creating a new WebP asset programmatically).

I'm using this library: https://mvnrepository.com/artifact/org.sejda.imageio/webp-imageio

Dependency:

<dependency>
<groupId>org.sejda.imageio</groupId>
<artifactId>webp-imageio</artifactId>
<version>0.1.6</version>
</dependency>

In the bnd-maven-plugin**,** I added it as an embedded dependency:

<configuration>
<bnd>
<![CDATA[
Embed-Dependency: *;scope=compile|runtime;inline=false
]]></bnd>
</configuration>

During OSGi service activation, I am getting this error below:

java.lang.NoClassDefFoundError: com/luciad/imageio/webp/WebPImageReaderSpi

The JAR contains classes under:

com.luciad.imageio.webp.*

What am I missing here? Why am I unable to properly embed this library**?** 
what are the other ways of achieving this, WebP image conversion?

4 replies

Anudeep_Garnepudi
Community Advisor
Community Advisor
January 28, 2026

@SyntaxError_07 change inline value to true in Embed-Dependency

AG
Level 2
January 28, 2026

@Anudeep_Garnepudi  changed the value to true, but still getting the same error.

Anudeep_Garnepudi
Community Advisor
Community Advisor
January 29, 2026

Remove Embed-Dependency and add Private-Package and try once.
Private-Package: com.luciad.imageio.*;version=0.1.6

AG
giuseppebaglio
Level 10
January 28, 2026

hi ​@SyntaxError_07,

try adding Private-Package which tells Bnd to include those classes in the bundle’s classpath

<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
Embed-Dependency: *;scope=compile|runtime;inline=false
Private-Package: com.luciad.imageio.webp*
]]></bnd>
</configuration>
</plugin>

 

You can also try leveraging Processing Profile wchich is the best practice for AEMasCS.

Please be aware you cannot use asset compute service from your local environment and you need access to AEMasCS instance.

Level 2
January 28, 2026

Hello ​@giuseppebaglio, i tried adding the private-package but same error, yes am aware of asset compute service not available in local env. 

Dipti_Chauhan
Community Advisor
Community Advisor
January 28, 2026

can you try using this 

<configuration>
    <bnd><![CDATA[
        Import-Package: *
        Export-Package: com.luciad.imageio.webp.*
        Embed-Dependency: webp-imageio;inline=true
    ]]></bnd>
</configuration>

 

If your goal is just to serve WebP to users for performance, you don't actually need to convert the assets in the DAM.

AEMaaCS Smart Imaging automatically converts images to WebP .

 

Thanks

Dipti Chauhan

Level 2
January 28, 2026

Tried the above and getting same error

AmitVishwakarma
Community Advisor
Community Advisor
January 28, 2026

Hi ​@SyntaxError_07 ,

On AEM as a Cloud Service, trying to embed webp-imageio (or similar WebP ImageIO codecs) into your OSGi bundle and use it in a DAM workflow is the wrong direction. These libraries rely on native code / JVM SPI behaviour that does not play well with the AEMaaCS container + OSGi runtime. You will keep running into NoClassDefFoundError/classloader issues, there is no magical Bnd header that makes this reliable.

What to do instead:
1. If your goal is just “serve WebP for performance”
Do not generate WebP assets in DAM at all.
Use AEMaaCS built‑in delivery:

  • Web‑optimized Image Delivery / Smart Imaging: AEM automatically delivers WebP (and AVIF) to capable browsers, while the asset itself stays as JPEG/PNG.
  • For Core Components, just enable “Web Optimized Images” on the Image component.
  • Or in custom code, use the AssetDelivery API to get optimized URLs instead of generating WebP files yourself.

That’s the supported, Cloud‑native solution.

2. If you truly must store a physical WebP rendition in DAM
Use an Asset Compute worker, not an in‑process Java library:

  • Create an Asset Compute project.
  • Implement a worker that:
    • Reads the source image.
    • Converts to WebP (via external service or library suited to Runtime).
    • Writes the .webp rendition back. Deploy it and wire it to DAM via Processing Profiles.

This is the supported way to create custom renditions in AEMaaCS, DAM workflows with native codecs are not.

Thanks,
Amit