java.lang.IllegalArgumentException: Property must not null or empty!

Spring JIRA | Michal Ondrovic | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Using StringPath(String var) with spring data 1.8.x or newer causes IllegalArgumentException

    GitHub | 2 years ago | anaq1
    java.lang.IllegalArgumentException: Property must not null or empty!
  2. 0

    In version 1.8.x was changed the way property path is resolved in class {{QSort}}. There is a private method {{preparePropertyPath(.)}}, which should return the correct path. But if the parent is {{null}}, it returns an empty {{String}} and this is probably not correct. For example when I use Querydsl {{StringPath}} like this: {code:java} QSort sort = new QSort(new OrderSpecifier<>(com.mysema.query.types.Order.ASC, new StringPath("eventTime"))); {code} an {{IllegalArgumentException}} is thrown: {noformat} java.lang.IllegalArgumentException: Property must not null or empty! at org.springframework.data.domain.Sort$Order.<init>(Sort.java:320) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.domain.Sort$Order.<init>(Sort.java:282) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.domain.Sort$Order.<init>(Sort.java:304) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.querydsl.QSort.toOrder(QSort.java:98) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.querydsl.QSort.toOrders(QSort.java:76) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.querydsl.QSort.<init>(QSort.java:59) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.querydsl.QSort.<init>(QSort.java:50) ~[spring-data-commons-1.9.3.RELEASE.jar:na] … {noformat} In version 1.7.x is it working as expected, no parent is needed. The recursion method {{preparePropertyPath(…)}} should be fixed.

    Spring JIRA | 2 years ago | Michal Ondrovic
    java.lang.IllegalArgumentException: Property must not null or empty!
  3. 0

    In version 1.8.x was changed the way property path is resolved in class {{QSort}}. There is a private method {{preparePropertyPath(.)}}, which should return the correct path. But if the parent is {{null}}, it returns an empty {{String}} and this is probably not correct. For example when I use Querydsl {{StringPath}} like this: {code:java} QSort sort = new QSort(new OrderSpecifier<>(com.mysema.query.types.Order.ASC, new StringPath("eventTime"))); {code} an {{IllegalArgumentException}} is thrown: {noformat} java.lang.IllegalArgumentException: Property must not null or empty! at org.springframework.data.domain.Sort$Order.<init>(Sort.java:320) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.domain.Sort$Order.<init>(Sort.java:282) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.domain.Sort$Order.<init>(Sort.java:304) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.querydsl.QSort.toOrder(QSort.java:98) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.querydsl.QSort.toOrders(QSort.java:76) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.querydsl.QSort.<init>(QSort.java:59) ~[spring-data-commons-1.9.3.RELEASE.jar:na] at org.springframework.data.querydsl.QSort.<init>(QSort.java:50) ~[spring-data-commons-1.9.3.RELEASE.jar:na] … {noformat} In version 1.7.x is it working as expected, no parent is needed. The recursion method {{preparePropertyPath(…)}} should be fixed.

    Spring JIRA | 2 years ago | Michal Ondrovic
    java.lang.IllegalArgumentException: Property must not null or empty!
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Property must not null or empty!

      at org.springframework.data.domain.Sort$Order.<init>()
    2. Spring Data Core
      QSort.<init>
      1. org.springframework.data.domain.Sort$Order.<init>(Sort.java:320)[spring-data-commons-1.9.3.RELEASE.jar:na]
      2. org.springframework.data.domain.Sort$Order.<init>(Sort.java:282)[spring-data-commons-1.9.3.RELEASE.jar:na]
      3. org.springframework.data.domain.Sort$Order.<init>(Sort.java:304)[spring-data-commons-1.9.3.RELEASE.jar:na]
      4. org.springframework.data.querydsl.QSort.toOrder(QSort.java:98)[spring-data-commons-1.9.3.RELEASE.jar:na]
      5. org.springframework.data.querydsl.QSort.toOrders(QSort.java:76)[spring-data-commons-1.9.3.RELEASE.jar:na]
      6. org.springframework.data.querydsl.QSort.<init>(QSort.java:59)[spring-data-commons-1.9.3.RELEASE.jar:na]
      7. org.springframework.data.querydsl.QSort.<init>(QSort.java:50)[spring-data-commons-1.9.3.RELEASE.jar:na]
      7 frames