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);

上一篇:netty研究【1】:编译源代码


下一篇:比较两个数据库表table结构不同之处