Assert.hasLength() has thrown an IllegalArgumentException

java.lang.IllegalArgumentException
Javadoc
Thrown to indicate that a method has been passed an illegal or inappropriate argument. @author unascribed @since JDK1.0
at org.springframework.util.Assert.hasLength
Source

Typical Exception Messages

  1. Display name must not be empty
  2. [Assertion failed] - this String argument must have length; it must not be null or empty
  3. username cannot be null or empty
  4. Class name must not be empty
  5. 'mediaType' must not be empty
  6. name for role cannot be null or empty
  7. key cannot be empty or null
  8. Name must not be empty
  9. - this String argument must have length; it must not be null or empty

Specific cases

We have seen this error pattern in the following webpages (27)

  1. 汪继友via Stack Overflow3 months ago
    Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.IllegalArgumentException: key cannot be empty or null
  2. Frank Endersvia uima-user9 months ago
    Display name must not be empty
  3. Marshall Schorvia uima-user9 months ago
  4. Jaroslaw Cwiklikvia uima-user9 months ago
  5. Marshall Schorvia incubator-uima-user9 months ago
  6. Jaroslaw Cwiklikvia incubator-uima-user9 months ago
  7. Marshall Schorvia uima-user9 months ago
  8. Jaroslaw Cwiklikvia uima-user9 months ago
  9. Unknown authorvia jenkins-ci.org1 year ago
    Error creating bean with name '(inner bean)': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: - this String argument must have length; it must not be null or empty
  10. Frank Endersvia uima-user1 year ago
    Display name must not be empty