java.lang.IllegalArgumentException: Multiple constructors with arguments found in class java.math.BigDecimal! Annotate one with @PreferedConstructor explicitly to select it to be used in persistence operations.

Spring JIRA | Sergey Alaev | 6 years ago
  1. 0

    Exception when trying to save an object with field of type java.math.BigDecimal This data type is quite popular and should be supported natively. java.lang.IllegalArgumentException: Multiple constructors with arguments found in class java.math.BigDecimal! Annotate one with @PreferedConstructor explicitly to select it to be used in persistence operations. at org.springframework.data.mapping.PreferredConstructorDiscoverer.<init>(PreferredConstructorDiscoverer.java:81) at org.springframework.data.mapping.BasicPersistentEntity.<init>(BasicPersistentEntity.java:49) at org.springframework.data.document.mongodb.mapping.BasicMongoPersistentEntity.<init>(BasicMongoPersistentEntity.java:47) at org.springframework.data.document.mongodb.mapping.MongoMappingContext.createPersistentEntity(MongoMappingContext.java:59) at org.springframework.data.document.mongodb.mapping.MongoMappingContext.createPersistentEntity(MongoMappingContext.java:33) at org.springframework.data.mapping.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:164) at org.springframework.data.mapping.AbstractMappingContext$1.doWith(AbstractMappingContext.java:201) at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513) at org.springframework.data.mapping.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:176) at org.springframework.data.mapping.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:133) at org.springframework.data.mapping.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:114) at org.springframework.data.mapping.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:58) at org.springframework.data.document.mongodb.convert.MappingMongoConverter.writeInternal(MappingMongoConverter.java:316) at org.springframework.data.document.mongodb.convert.MappingMongoConverter.write(MappingMongoConverter.java:287)

    Spring JIRA | 6 years ago | Sergey Alaev
    java.lang.IllegalArgumentException: Multiple constructors with arguments found in class java.math.BigDecimal! Annotate one with @PreferedConstructor explicitly to select it to be used in persistence operations.
  2. 0

    Exception when trying to save an object with field of type java.math.BigDecimal This data type is quite popular and should be supported natively. java.lang.IllegalArgumentException: Multiple constructors with arguments found in class java.math.BigDecimal! Annotate one with @PreferedConstructor explicitly to select it to be used in persistence operations. at org.springframework.data.mapping.PreferredConstructorDiscoverer.<init>(PreferredConstructorDiscoverer.java:81) at org.springframework.data.mapping.BasicPersistentEntity.<init>(BasicPersistentEntity.java:49) at org.springframework.data.document.mongodb.mapping.BasicMongoPersistentEntity.<init>(BasicMongoPersistentEntity.java:47) at org.springframework.data.document.mongodb.mapping.MongoMappingContext.createPersistentEntity(MongoMappingContext.java:59) at org.springframework.data.document.mongodb.mapping.MongoMappingContext.createPersistentEntity(MongoMappingContext.java:33) at org.springframework.data.mapping.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:164) at org.springframework.data.mapping.AbstractMappingContext$1.doWith(AbstractMappingContext.java:201) at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513) at org.springframework.data.mapping.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:176) at org.springframework.data.mapping.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:133) at org.springframework.data.mapping.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:114) at org.springframework.data.mapping.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:58) at org.springframework.data.document.mongodb.convert.MappingMongoConverter.writeInternal(MappingMongoConverter.java:316) at org.springframework.data.document.mongodb.convert.MappingMongoConverter.write(MappingMongoConverter.java:287)

    Spring JIRA | 6 years ago | Sergey Alaev
    java.lang.IllegalArgumentException: Multiple constructors with arguments found in class java.math.BigDecimal! Annotate one with @PreferedConstructor explicitly to select it to be used in persistence operations.
  3. 0
    Probably you try to create an actor using actorSystem.actorOf(Props(classOf[AnyActor], args...)) where args does not match AnyActor constructor parameters.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    This error is caused by malformed HTTP request. You are trying to access unsecured page through https.
  6. 0
    Some bots are sending malformed HTTP requests to your site. Try to find their IP addresses in the access logs and ask them to fix the bots or blacklist them.

    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. java.lang.IllegalArgumentException

      Multiple constructors with arguments found in class java.math.BigDecimal! Annotate one with @PreferedConstructor explicitly to select it to be used in persistence operations.

      at org.springframework.data.mapping.PreferredConstructorDiscoverer.<init>()
    2. Spring Data Core
      BasicPersistentEntity.<init>
      1. org.springframework.data.mapping.PreferredConstructorDiscoverer.<init>(PreferredConstructorDiscoverer.java:81)
      2. org.springframework.data.mapping.BasicPersistentEntity.<init>(BasicPersistentEntity.java:49)
      2 frames
    3. org.springframework.data
      MongoMappingContext.createPersistentEntity
      1. org.springframework.data.document.mongodb.mapping.BasicMongoPersistentEntity.<init>(BasicMongoPersistentEntity.java:47)
      2. org.springframework.data.document.mongodb.mapping.MongoMappingContext.createPersistentEntity(MongoMappingContext.java:59)
      3. org.springframework.data.document.mongodb.mapping.MongoMappingContext.createPersistentEntity(MongoMappingContext.java:33)
      3 frames
    4. Spring Data Core
      AbstractMappingContext$1.doWith
      1. org.springframework.data.mapping.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:164)
      2. org.springframework.data.mapping.AbstractMappingContext$1.doWith(AbstractMappingContext.java:201)
      2 frames
    5. Spring Core
      ReflectionUtils.doWithFields
      1. org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513)
      1 frame
    6. Spring Data Core
      AbstractMappingContext.getPersistentEntity
      1. org.springframework.data.mapping.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:176)
      2. org.springframework.data.mapping.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:133)
      3. org.springframework.data.mapping.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:114)
      4. org.springframework.data.mapping.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:58)
      4 frames
    7. org.springframework.data
      MappingMongoConverter.write
      1. org.springframework.data.document.mongodb.convert.MappingMongoConverter.writeInternal(MappingMongoConverter.java:316)
      2. org.springframework.data.document.mongodb.convert.MappingMongoConverter.write(MappingMongoConverter.java:287)
      2 frames