org.springframework.data.mapping.model.MappingException: No property signed found on [class]!

Spring JIRA | Andy Chang | 2 years ago
  1. 0

    I have an entity that has a field called {{signedDate}} but I have annotated it with {{@Field("signed")}}. I also have a method {{isSigned()}} in the same entity, which basically returns whether {{signedDate}} is {{null}} or not. When I perform any update operations using {{MongoOperations}} involving the {{signed}}/{{signedDate}} field, it gives the following error, even if I mark {{isSigned()}} as transient: {noformat} Exception in thread "main" org.springframework.data.mapping.model.MappingException: No property signed found on [class]! at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath(AbstractMappingContext.java:237) at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath(AbstractMappingContext.java:215) at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath(AbstractMappingContext.java:203) at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.getPath(QueryMapper.java:746) at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.<init>(QueryMapper.java:637) at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.<init>(QueryMapper.java:614) at org.springframework.data.mongodb.core.convert.UpdateMapper$MetadataBackedUpdateField.<init>(UpdateMapper.java:178) at org.springframework.data.mongodb.core.convert.UpdateMapper.createPropertyField(UpdateMapper.java:149) at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObject(QueryMapper.java:113) at org.springframework.data.mongodb.core.convert.QueryMapper.convertSimpleOrDBObject(QueryMapper.java:294) at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedKeyword(QueryMapper.java:178) at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObject(QueryMapper.java:91) at org.springframework.data.mongodb.core.MongoTemplate$11.doInCollection(MongoTemplate.java:1006) at org.springframework.data.mongodb.core.MongoTemplate$11.doInCollection(MongoTemplate.java:997) at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:410) at org.springframework.data.mongodb.core.MongoTemplate.doUpdate(MongoTemplate.java:997) at org.springframework.data.mongodb.core.MongoTemplate.updateFirst(MongoTemplate.java:971) {noformat} I am attaching a maven project that produces the problem.

    Spring JIRA | 2 years ago | Andy Chang
    org.springframework.data.mapping.model.MappingException: No property signed found on [class]!
  2. 0

    I have an entity that has a field called {{signedDate}} but I have annotated it with {{@Field("signed")}}. I also have a method {{isSigned()}} in the same entity, which basically returns whether {{signedDate}} is {{null}} or not. When I perform any update operations using {{MongoOperations}} involving the {{signed}}/{{signedDate}} field, it gives the following error, even if I mark {{isSigned()}} as transient: {noformat} Exception in thread "main" org.springframework.data.mapping.model.MappingException: No property signed found on [class]! at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath(AbstractMappingContext.java:237) at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath(AbstractMappingContext.java:215) at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath(AbstractMappingContext.java:203) at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.getPath(QueryMapper.java:746) at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.<init>(QueryMapper.java:637) at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.<init>(QueryMapper.java:614) at org.springframework.data.mongodb.core.convert.UpdateMapper$MetadataBackedUpdateField.<init>(UpdateMapper.java:178) at org.springframework.data.mongodb.core.convert.UpdateMapper.createPropertyField(UpdateMapper.java:149) at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObject(QueryMapper.java:113) at org.springframework.data.mongodb.core.convert.QueryMapper.convertSimpleOrDBObject(QueryMapper.java:294) at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedKeyword(QueryMapper.java:178) at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObject(QueryMapper.java:91) at org.springframework.data.mongodb.core.MongoTemplate$11.doInCollection(MongoTemplate.java:1006) at org.springframework.data.mongodb.core.MongoTemplate$11.doInCollection(MongoTemplate.java:997) at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:410) at org.springframework.data.mongodb.core.MongoTemplate.doUpdate(MongoTemplate.java:997) at org.springframework.data.mongodb.core.MongoTemplate.updateFirst(MongoTemplate.java:971) {noformat} I am attaching a maven project that produces the problem.

    Spring JIRA | 2 years ago | Andy Chang
    org.springframework.data.mapping.model.MappingException: No property signed found on [class]!
  3. 0

    MongoDB + Spring MVC

    Stack Overflow | 2 years ago | JavaDevil
    org.springframework.data.mapping.model.MappingException: No property status found on com.avis.bean.Agreement! at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath(AbstractMappingContext.java:228)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    There is a model is like: {code:java} class Model { .... @DBRef List<OtherModel> members; ... } {code} and I need sliced access to the members variable. I use this query: {code:java} ObjectId objectId = new ObjectId("55c36f44f359d8a455a21f68"); Query query = new Query(Criteria.where("_id").is(objectId)); query.fields().slice("members", pageable.getOffset(), pageable.getPageSize()); List<Model> models = mongoTemplate.findOne(query, Model.class); {code} And I get this exception: {code:java} org.springframework.data.mapping.model.MappingException: No id property found on class class [Ljava.lang.Integer; at org.springframework.data.mongodb.core.convert.MappingMongoConverter.createDBRef(MappingMongoConverter.java:842) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.toDBRef(MappingMongoConverter.java:329) at org.springframework.data.mongodb.core.convert.QueryMapper.createDbRefFor(QueryMapper.java:460) at org.springframework.data.mongodb.core.convert.QueryMapper.convertAssociation(QueryMapper.java:417) at org.springframework.data.mongodb.core.convert.QueryMapper.convertAssociation(QueryMapper.java:378) at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedKeyword(QueryMapper.java:257) at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObjectForField(QueryMapper.java:200) at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObject(QueryMapper.java:123) at org.springframework.data.mongodb.core.MongoTemplate.doFindOne(MongoTemplate.java:1647) at org.springframework.data.mongodb.core.MongoTemplate.findOne(MongoTemplate.java:563) at org.springframework.data.mongodb.core.MongoTemplate.findOne(MongoTemplate.java:558) {code} where a field: {code:java} boolean needsAssociationConversion = property.isAssociation() && !keyword.isExists(); {code} is set. It checks against isExists, but not against something like isSliced (which does not yet exist) and therefore is evaluated to true and, as a cause, tries to convert the non-existing association which is, in this case, just the slice-directive (an integer array). When I set the variable needsAssociationConversion to false while debugging, as if a kind of {code:java} keyword.isSlice() {code} check was done, everything works fine.

    Spring JIRA | 1 year ago | Zhu Hongshang
    org.springframework.data.mapping.model.MappingException: No id property found on class class [Ljava.lang.Integer;

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.data.mapping.model.MappingException

      No property signed found on [class]!

      at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath()
    2. Spring Data Core
      AbstractMappingContext.getPersistentPropertyPath
      1. org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath(AbstractMappingContext.java:237)
      2. org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath(AbstractMappingContext.java:215)
      3. org.springframework.data.mapping.context.AbstractMappingContext.getPersistentPropertyPath(AbstractMappingContext.java:203)
      3 frames
    3. Spring Data MongoDB - Core
      MongoTemplate.updateFirst
      1. org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.getPath(QueryMapper.java:746)
      2. org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.<init>(QueryMapper.java:637)
      3. org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.<init>(QueryMapper.java:614)
      4. org.springframework.data.mongodb.core.convert.UpdateMapper$MetadataBackedUpdateField.<init>(UpdateMapper.java:178)
      5. org.springframework.data.mongodb.core.convert.UpdateMapper.createPropertyField(UpdateMapper.java:149)
      6. org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObject(QueryMapper.java:113)
      7. org.springframework.data.mongodb.core.convert.QueryMapper.convertSimpleOrDBObject(QueryMapper.java:294)
      8. org.springframework.data.mongodb.core.convert.QueryMapper.getMappedKeyword(QueryMapper.java:178)
      9. org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObject(QueryMapper.java:91)
      10. org.springframework.data.mongodb.core.MongoTemplate$11.doInCollection(MongoTemplate.java:1006)
      11. org.springframework.data.mongodb.core.MongoTemplate$11.doInCollection(MongoTemplate.java:997)
      12. org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:410)
      13. org.springframework.data.mongodb.core.MongoTemplate.doUpdate(MongoTemplate.java:997)
      14. org.springframework.data.mongodb.core.MongoTemplate.updateFirst(MongoTemplate.java:971)
      14 frames