@Override
@Bean
public MappingMongoConverter mappingMongoConverter() throws Exception {
DefaultDbRefResolver dbRefResolver = new DefaultDbRefResolver(this.mongoDbFactory());
MappingMongoConverter converter = new MappingMongoConverter(dbRefResolver, this.mongoMappingContext());
converter.setCustomConversions(this.customConversions());
converter.setMapKeyDotReplacement("_");
return converter;
}
但是如果我尝试解析这个JSON,即Java JSONObject:
{
"Dr.Web category": "known infection source",
"categories": [
"parked",
"uncategorized"
]
}
此异常总是会发生。
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.data.mapping.model.MappingException: Map key Dr.Web category contains dots but no replacement was configured! Make sure map keys don't contain dots in the first place or configure an appropriate replacement!
这是奇怪的原因,实际上设置了setMapKeyDotReplacement,因此应该替换所有点。
您对此解决方案不起作用有什么想法吗?
答案 0 :(得分:0)
在return语句之前尝试包含+ echo 'myPassword = [*******]'
myPassword = [*******]
。