Nacho321
Nacho321

Reputation: 1991

StackOverflowError after 100 characters in Apache Commons EmailValidator

I am using Apache's Email Validator to validate the customer's input.

I've found an issue where, if the customer inputs more than 100 characters, I get the following error

enter image description here

This is my code:

if (!EmailValidator.getInstance().isValid(email)) {
    // ...
}

Any ideas what the problem is, and why the validator isn't able to handle this scenario with 100+ characters?

Upvotes: 0

Views: 337

Answers (1)

Nacho321
Nacho321

Reputation: 1991

After digging, I found that there is a known error in Apache's EmailValidator. https://issues.apache.org/jira/browse/VALIDATOR-365

The best solution seems to be restricting the field to the max length that the validator allows.

Upvotes: 2

Related Questions