Contact Us 1-800-596-4880

Troubleshooting the Validation Module - Mule 4

To troubleshoot the Validation module, become familiar with the information about enabling verbose logging and interpreting commonly thrown messages.

Enable Verbose Logging

To get a better understanding of why an application’s interaction with the Validation module is failing, temporarily enable verbose logging for the module.

Remember to always disable the enhanced verbosity after troubleshooting, because it affects your Mule application performance.

To enable verbose logging in the configuration file:

  1. Access Anypoint Studio and navigate to the Package Explorer view.

  2. Open your application’s project name.

  3. Open the src/main/resources path folder.

  4. Open the log4j2.xml file inside the folder.

  5. Add an <AsyncLogger> tag inside the <Loggers> tag:

    			<Loggers>
    				...
    				<AsyncLogger name="org.mule.extension.validation" level="DEBUG"/>
    				...
    			</Loggers>
  6. Save your application changes.

  7. Click the project name in Package Explorer and then click Run > Run As > Mule Application.

Understand Common Throws

Here is a list of common throw messages and how to interpret them:

  • VALIDATION:BLANK_STRING

    The provided value is an empty string and the expected value is not.
  • VALIDATION:NOT_BLANK_STRING

    The provided value is not an empty string and the expected value is.
  • VALIDATION:ELAPSED_TIME

    Too much time has elapsed since the specified start time.
  • VALIDATION:NOT_ELAPSED_TIME

    Not enough time has elapsed since the specified start time.
  • VALIDATION:INVALID_EMAIL

    The provided value is an invalid email address.
  • VALIDATION:EMPTY_COLLECTION

    The provided value is an empty collection and the expected value is not.
  • VALIDATION:NOT_EMPTY_COLLECTION

    The provided value is an empty collection and the expected value is not.
  • VALIDATION:INVALID_BOOLEAN

    The provided value does not match the expected boolean value.
  • VALIDATION:INVALID_IP

    The provided value is an invalid IP address.
  • VALIDATION:REJECTED_IP

    The provided value is not valid according to the expecting ranges.
  • VALIDATION:NULL

    The value provided is null. Keep in mind that the definition of `null` can vary depending on the mimeType value. For example, for an `application/java` mimeType, `null` means a blank pointer. However, if the mimeType is `application/json`, then the String `null` is also a null value.
  • VALIDATION:NOT_NULL

    The value provided is not null. Keep in mind that the definition of `null` can vary depending on the mimeType value. For example, for an `application/java` mimeType, `null` means a blank pointer. However, if the mimeType is `application/json`, then the String `null` is also a null value.
  • VALIDATION:INVALID_NUMBER

    The provided value does not satisfy either the number type or the minimum or maximum expected values.
  • VALIDATION:INVALID_TIME

    The provided value is an invalid time for the pattern used to parse it. If no pattern is provided, then the locale's default is used.
  • VALIDATION:INVALID_URL

    The provided value is an invalid URL.
  • VALIDATION:MISMATCH

    The provided value does not match the regular expression.
  • VALIDATION:INVALID_SIZE

    The provided value is not between the specified inclusive boundaries.
  • VALIDATION:MULTIPLE

    Summarizes all the found errors in a list of nested validation operations.
View on GitHub