zhltom 发表于 2015-7-10 01:07:35

MongoDB Error

  ①,org.springframework.core.convert.ConverterNotFoundException: No converter found capable of   converting from type org.joda.time.LocalDate to type java.lang.String
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)
  解决方案:converter.afterPropertiesSet();
  MappingMongoConverter converter = new MappingMongoConverter(mongoDbFactory, context);
converter.setTypeMapper(mapper);
converter.setCustomConversions(new CustomConversions(Arrays.asList(new TimeZoneReadConverter(),new TimeZoneWriteConverter())));
converter.afterPropertiesSet();
MongoTemplate template = new MongoTemplate(mongoDbFactory, converter);

  
页: [1]
查看完整版本: MongoDB Error