<Loggers>
...
<AsyncLogger name="org.mule.extension.validation" level="DEBUG"/>
...
</Loggers>
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:
-
Access Anypoint Studio and navigate to the Package Explorer view.
-
Open your application’s project name.
-
Open the
src/main/resources
path folder. -
Open the
log4j2.xml
file inside the folder. -
Add an
<AsyncLogger>
tag inside the<Loggers>
tag: -
Save your application changes.
-
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.