Results 1 to 3 of 3

Thread: java.lang.NullPointerException at StringBasedMongoQuery.getParameterWithIndex

  1. #1
    Join Date
    Feb 2012
    Posts
    1

    Default 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. #2
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    483

    Default

    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.

  3. #3
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    483

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •