HugeGraph创建propertyKey出现The name of property key can't be null

1、发生错误场景(开发环境)

复制代码
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.baidu.hugegraph.driver.GremlinManager;
import com.baidu.hugegraph.driver.HugeClient;
import com.baidu.hugegraph.driver.SchemaManager;
public class SingleExample {
    public static void main(String[] args) throws IOException {
        HugeClient hugeClient = null;
        try {
            // If connect failed will throw a exception.
            hugeClient = HugeClient.builder("http://192.168.66.83:8080",
                    "hugegraph")
                    .build();
            SchemaManager schema = hugeClient.schema();
            schema.propertyKey("aaa3").asText().valueSingle().ifNotExist().create();
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            hugeClient.close();
        }
    }
}
复制代码

2、发生错误时的报错内容

Caused by: com.baidu.hugegraph.exception.ServerException: The name of property key can't be null

3、解决

  fastjson依赖冲突导致,将依赖替换为1.1.X版本即可,我这边替换为1.1.45版本后,再次运行就好了

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>1.1.45</version>
</dependency>

4、参考地址:https://github.com/apache/incubator-hugegraph/issues/5

posted @   落魄的大数据转AI小哥  阅读(101)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示