org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type byte[] to type MyClass

Spring JIRA | Alexander Oleynikov | 3 years ago
  1. 0

    {{MappingMongoConverter}} doesn't try to convert binary data using registered {{Converter<org.bson.types.Binary, MyClass>}} and throws {noformat} org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type byte[] to type MyClass at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:475) at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:175) at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:154) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.getPotentiallyConvertedSimpleRead(MappingMongoConverter.java:670) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readValue(MappingMongoConverter.java:1007) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.access$100(MappingMongoConverter.java:75) at org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:954) at org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:921) at org.springframework.data.mapping.model.PersistentEntityParameterValueProvider.getParameterValue(PersistentEntityParameterValueProvider.java:78) at org.springframework.data.mapping.model.SpELExpressionParameterValueProvider.getParameterValue(SpELExpressionParameterValueProvider.java:63) at org.springframework.data.convert.ReflectionEntityInstantiator.createInstance(ReflectionEntityInstantiator.java:71) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:232) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:212) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:176) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:172) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:75) at org.springframework.data.mongodb.core.MongoTemplate$ReadDbObjectCallback.doWith(MongoTemplate.java:1836) at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1487) at org.springframework.data.mongodb.core.MongoTemplate.doFindAndModify(MongoTemplate.java:1419) at org.springframework.data.mongodb.core.MongoTemplate.findAndModify(MongoTemplate.java:560) at org.springframework.data.mongodb.core.MongoTemplate.findAndModify(MongoTemplate.java:547) {noformat} That is confusing because {{Converter<MyClass, org.bson.types.Binary>}} is picked up and used correctly putting BinData object to db.

    Spring JIRA | 3 years ago | Alexander Oleynikov
    org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type byte[] to type MyClass
  2. 0

    {{MappingMongoConverter}} doesn't try to convert binary data using registered {{Converter<org.bson.types.Binary, MyClass>}} and throws {noformat} org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type byte[] to type MyClass at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:475) at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:175) at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:154) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.getPotentiallyConvertedSimpleRead(MappingMongoConverter.java:670) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readValue(MappingMongoConverter.java:1007) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.access$100(MappingMongoConverter.java:75) at org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:954) at org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:921) at org.springframework.data.mapping.model.PersistentEntityParameterValueProvider.getParameterValue(PersistentEntityParameterValueProvider.java:78) at org.springframework.data.mapping.model.SpELExpressionParameterValueProvider.getParameterValue(SpELExpressionParameterValueProvider.java:63) at org.springframework.data.convert.ReflectionEntityInstantiator.createInstance(ReflectionEntityInstantiator.java:71) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:232) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:212) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:176) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:172) at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:75) at org.springframework.data.mongodb.core.MongoTemplate$ReadDbObjectCallback.doWith(MongoTemplate.java:1836) at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1487) at org.springframework.data.mongodb.core.MongoTemplate.doFindAndModify(MongoTemplate.java:1419) at org.springframework.data.mongodb.core.MongoTemplate.findAndModify(MongoTemplate.java:560) at org.springframework.data.mongodb.core.MongoTemplate.findAndModify(MongoTemplate.java:547) {noformat} That is confusing because {{Converter<MyClass, org.bson.types.Binary>}} is picked up and used correctly putting BinData object to db.

    Spring JIRA | 3 years ago | Alexander Oleynikov
    org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type byte[] to type MyClass
  3. 0

    Neo4jTemplate.save(): ConverterNotFoundException when using manually created and attached 1:1 entity

    GitHub | 4 years ago | SchulteMarkus
    javax.faces.FacesException: #{companyBean.submit}: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type domain.entities.Root to type org.springframework.data.neo4j.support.Neo4jTemplate
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Set MongoDb converter programatically

    Stack Overflow | 4 years ago | Daniel
    org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type org.joda.time.LocalDate to type java.lang.String
  6. 0

    MongoDB map reduce, gives error " No converter found capable of converting from type java.lang.Boolean to type int"

    Stack Overflow | 3 years ago | jeff porter
    org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type java.lang.Boolean to type int

  1. shiva768 1 times, last 12 months ago
9 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.core.convert.ConverterNotFoundException

    No converter found capable of converting from type byte[] to type MyClass

    at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound()
  2. Spring Core
    GenericConversionService.convert
    1. org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:475)
    2. org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:175)
    3. org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:154)
    3 frames
  3. Spring Data MongoDB - Core
    MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue
    1. org.springframework.data.mongodb.core.convert.MappingMongoConverter.getPotentiallyConvertedSimpleRead(MappingMongoConverter.java:670)
    2. org.springframework.data.mongodb.core.convert.MappingMongoConverter.readValue(MappingMongoConverter.java:1007)
    3. org.springframework.data.mongodb.core.convert.MappingMongoConverter.access$100(MappingMongoConverter.java:75)
    4. org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:954)
    5. org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:921)
    5 frames
  4. Spring Data Core
    ReflectionEntityInstantiator.createInstance
    1. org.springframework.data.mapping.model.PersistentEntityParameterValueProvider.getParameterValue(PersistentEntityParameterValueProvider.java:78)
    2. org.springframework.data.mapping.model.SpELExpressionParameterValueProvider.getParameterValue(SpELExpressionParameterValueProvider.java:63)
    3. org.springframework.data.convert.ReflectionEntityInstantiator.createInstance(ReflectionEntityInstantiator.java:71)
    3 frames
  5. Spring Data MongoDB - Core
    MongoTemplate.findAndModify
    1. org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:232)
    2. org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:212)
    3. org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:176)
    4. org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:172)
    5. org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:75)
    6. org.springframework.data.mongodb.core.MongoTemplate$ReadDbObjectCallback.doWith(MongoTemplate.java:1836)
    7. org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1487)
    8. org.springframework.data.mongodb.core.MongoTemplate.doFindAndModify(MongoTemplate.java:1419)
    9. org.springframework.data.mongodb.core.MongoTemplate.findAndModify(MongoTemplate.java:560)
    10. org.springframework.data.mongodb.core.MongoTemplate.findAndModify(MongoTemplate.java:547)
    10 frames