[英]ArangoDB Spring Data 2, java.lang.Object / invalid map type
I have recently upgraded to Spring Boot 2 (and therefore Spring data 2) and have the latest Arango java driver and arango-spring-data versions (5.0.1 and 3.1.1 respectively)我最近升级到 Spring Boot 2(因此升级到 Spring data 2)并拥有最新的 Arango java 驱动程序和 arango-spring-data 版本(分别为 5.0.1 和 3.1.1)
I'm now having problems fetching a property with type java.lang.Object
我现在在获取
java.lang.Object
类型的属性时遇到问题
I get this error我收到这个错误
.... due to HttpClientErrorException: {"status":"BAD_REQUEST","timestamp":"2018-11-10 17:20:07","message":"Bad request. The server cannot complete the request as it is invalid.","detailMessage":"Unsupported Map type: java.lang.Object","invalidParameters":[]}
I can see that in the DefaultArangoConverter
if the type is Object it's been treated as if it were a map...我可以在
DefaultArangoConverter
看到,如果类型是 Object,则它被视为地图...
if (typeToUse.isMap() || ClassTypeInformation.OBJECT.equals(typeToUse)) {
return readMap(typeToUse, source);
}
.... ....
in readMap(..)
在
readMap(..)
final Map<Object, Object> map = CollectionFactory.createMap(type.getType(), keyType, source.size());
CollectionFactory is used to make the "map" - and it's not happy. CollectionFactory 用于制作“地图” - 它不高兴。
CollectionFactory.java
} else if (!Map.class.isAssignableFrom(mapType)) {
throw new IllegalArgumentException("Unsupported Map type: " + mapType.getName());
Does anyone else get this?有没有其他人得到这个? I may have config'd incorreclty, but I'm using fairly out-of-the-box config.
我的配置可能不正确,但我使用的是相当开箱即用的配置。
Update: If the type is Map
it works ok, but if the map contains a map (ie in one of the 'values') I get the same error.更新:如果类型是
Map
它工作正常,但如果地图包含地图(即在“值”之一中)我得到同样的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.