Skip to content

Root cause of IllegalArgumentException is hidden in AdaptiveServlet when content policy has no widths configured. #3019

@ofarganc

Description

@ofarganc

Bug Report

Current Behavior

  • configure the image component and don't set any widths in the content policy.
  • when trying to access the servlet with any width the logs show the message:
    "Third selector must contain a valid width information (selector > 0)"
    The root cause of the exception is that the widths are not configured and there is an exception thrown that has the message: "The requested width is not allowed in the content policy or no default"

Expected behavior/code

  • just if the message of the root cause would be displayed, it would be enough and easier to debug this.

Environment

  • AEM version and patch level: AEMaaCS SDK 2025.9.22450.20250911T131210Z-250800
  • Core Components version: latest
  • JRE version: 21.0.8+9-LTS

Possible Solution

  • adding the root cause to the exception thrown will suffice. PR incoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions