apache / incubator-hugegraph

A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends)
https://hugegraph.apache.org
Apache License 2.0
2.62k stars 517 forks source link

0.11.2版,开启raft启动报错 #1281

Closed chentianlong1993 closed 3 years ago

chentianlong1993 commented 3 years ago

报错信息如下 image 看到hugegraph代码中在启动rpcServer时会对bolt这两个属性赋值 image 但jraft源码中BoltRaftRpcFactory这两个属性是被static final修饰的基本类型,是否无法通过反射赋值? image 我自己写demo用同样的方式赋值,也是一样的错 image

javeme commented 3 years ago

@chentianlong1993 可以试试tar包下载的方式,同时我们也看看差异。 如果使用源码的话可以参考: https://stackoverflow.com/questions/3301635/change-private-static-final-field-using-java-reflection

chentianlong1993 commented 3 years ago

@javeme 感谢回复 我是在release-0.11这个分支拉的代码,除了上述问题外,看到rocksdb版本升级到了6.10.2,但引用的jraft是1.3.3,此版本的jraft不兼容6.10.2的rocksdb,启动过程中会抛出noSuchMethodException,尝试huge中将rocksdb版本修改为6.3.6,可解决。 另外,我查看了stackoverflow中给的例子,是用Boolean包装类型做示例,我尝试用static final Integer做测试,此方法可行,但static final int做测试,跟之前比是不会抛出异常了,但赋值仍然无效。

Linary commented 3 years ago

@chentianlong1993 我们修改过jraft的源码。我们已经上传了tar供下载使用了,如果是必须要自行编译,我们尽快适配原版jraft