ArangoDB Spring数据2,java.lang.Object/映射类型无效
我最近升级到SpringBoot2(因此也升级到SpringData2),并拥有最新的ArangoJava驱动程序和ArangoSpringData版本(分别为5.0.1和3.1.1) 我现在在获取类型为ArangoDB Spring数据2,java.lang.Object/映射类型无效,java,spring-boot,spring-data,arangodb,Java,Spring Boot,Spring Data,Arangodb,我最近升级到SpringBoot2(因此也升级到SpringData2),并拥有最新的ArangoJava驱动程序和ArangoSpringData版本(分别为5.0.1和3.1.1) 我现在在获取类型为java.lang.Object 我得到这个错误 .... due to HttpClientErrorException: {"status":"BAD_REQUEST","timestamp":"2018-11-10 17:20:07","message":"Bad request. The
java.lang.Object
我得到这个错误
.... 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":[]}
我可以看到,在DefaultArangoConverter
中,如果类型是Object,则将其视为映射
if (typeToUse.isMap() || ClassTypeInformation.OBJECT.equals(typeToUse)) {
return readMap(typeToUse, source);
}
在readMap(..)
还有人收到这个吗?
我的配置可能不正确,但我使用的是现成的配置
更新:
如果类型是
Map
,它工作正常,但是如果Map包含一个Map(即在一个“值”中),我会得到相同的错误。这是arangodb spring数据当前版本中的一个错误
我已经在github上创建了一个解决方案。谢谢,响应速度非常快!
final Map<Object, Object> map = CollectionFactory.createMap(type.getType(), keyType, source.size());
CollectionFactory.java
} else if (!Map.class.isAssignableFrom(mapType)) {
throw new IllegalArgumentException("Unsupported Map type: " + mapType.getName());