Announcement Announcement Module
Collapse
No announcement yet.
java.lang.NullPointerException at StringBasedMongoQuery.getParameterWithIndex Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.NullPointerException at StringBasedMongoQuery.getParameterWithIndex

    I made below function. but it makes Exception.

    @Query("{$or:[{'sourceId':?0}, {'targetId':?1}]}")
    Page<VO> findById(BigDecimal sourceId, BigDecimal targetId, Pageable pageable);

    java.lang.NullPointerException
    at org.springframework.data.mongodb.repository.query. StringBasedMongoQuery.getParameterWithIndex(String BasedMongoQuery.java:103)
    at org.springframework.data.mongodb.repository.query. StringBasedMongoQuery.replacePlaceholders(StringBa sedMongoQuery.java:95)
    after I followed the code, I found empty parameters after first parameter.
    Is it a bug?

  • #2
    It seems to be, we're not guarding against the piped in parameter potentially being null when doing the getClass() call. Feel free to submit a bug.

    Comment


    • #3
      Bug captured in https://jira.springsource.org/browse/DATAMONGO-401, already fixed and available in the 1.0.1 maintenance release available through Maven central.

      Comment

      Working...
      X