-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
客户端报错 Cannot evaluate com.vesoft.nebula.client.graph.data.ResultSet.toString() #335
Comments
Import the wrong ResultSet module? |
import com.vesoft.nebula.client.graph.NebulaPoolConfig;
import com.vesoft.nebula.client.graph.data.HostAddress;
import com.vesoft.nebula.client.graph.data.ResultSet;
import com.vesoft.nebula.client.graph.net.NebulaPool;
import com.vesoft.nebula.client.graph.net.Session; 没有导入错误 |
There maybe exists the null pointer in the old version of toString, so the IDE receives this exception and reports this error. The master code has fixed the null pointer issue so that the IDE does not report errors. |
<!-- https://mvnrepository.com/artifact/com.vesoft/client -->
<dependency>
<groupId>com.vesoft</groupId>
<artifactId>client</artifactId>
<version>2.0.0</version>
</dependency> 是不是这个版本的客户端不支持nebula 2.0.1版本 |
请问一下我现在安装的nebula需要引入什么版本的客户端呢,是需要下载客户端源码自己编译master分支吗 |
The master client couldn’t use 2.0.1 server, it must use master server. |
那这个nebula2.0.1 是不是目前没有客户端可以用? |
2.0.0 client can use with 2.0.0/2.0.1 server |
可是我目前使用的2.0.0版本的客户端会报错 空指针异常啊,but client v2.0.0 it does not work! |
That's just a warning from the IDE. |
非常感谢!!,这个问题已经解决了,我发现我使用客户端的时候必须先指定space,如果不指定运行时就会提示空指针异常。 其实这边建议没指定space的话客户端给个未指定space的错误提示。 |
Can you provide the picture information of the exception? |
先贴上我的代码 package fun;
import com.vesoft.nebula.client.graph.NebulaPoolConfig;
import com.vesoft.nebula.client.graph.data.HostAddress;
import com.vesoft.nebula.client.graph.data.ResultSet;
import com.vesoft.nebula.client.graph.data.ValueWrapper;
import com.vesoft.nebula.client.graph.net.NebulaPool;
import com.vesoft.nebula.client.graph.net.Session;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.List;
/**
* @FileDescription
* @Create 2021-08-03 9:59
*/
public class CuraterTest {
public static void main(String[] args) throws Exception {
NebulaPoolConfig nebulaPoolConfig = new NebulaPoolConfig();
nebulaPoolConfig.setMaxConnSize(10);
List<HostAddress> addresses = Arrays.asList(new HostAddress("127.0.0.1", 9669) );
NebulaPool pool = new NebulaPool();
pool.init(addresses, nebulaPoolConfig);
Session session = pool.getSession("root", "nebula", false);
// ResultSet use_test = session.execute("use test");
ResultSet show_edges = session.execute("show edges");
printResult(show_edges);
session.release();
pool.close();
}
private static void printResult(ResultSet resultSet) throws UnsupportedEncodingException {
List<String> colNames = resultSet.keys();
for (String name : colNames) {
System.out.printf("%15s |", name);
}
System.out.println();
for (int i = 0; i < resultSet.rowsSize(); i++) {
ResultSet.Record record = resultSet.rowValues(i);
for (ValueWrapper value : record.values()) {
if (value.isLong()) {
System.out.printf("%15s |", value.asLong());
}
if (value.isBoolean()) {
System.out.printf("%15s |", value.asBoolean());
}
if (value.isDouble()) {
System.out.printf("%15s |", value.asDouble());
}
if (value.isString()) {
System.out.printf("%15s |", value.asString());
}
if (value.isTime()) {
System.out.printf("%15s |", value.asTime());
}
if (value.isDate()) {
System.out.printf("%15s |", value.asDate());
}
if (value.isDateTime()) {
System.out.printf("%15s |", value.asDateTime());
}
if (value.isVertex()) {
System.out.printf("%15s |", value.asNode());
}
if (value.isEdge()) {
System.out.printf("%15s |", value.asRelationship());
}
if (value.isPath()) {
System.out.printf("%15s |", value.asPath());
}
if (value.isList()) {
System.out.printf("%15s |", value.asList());
}
if (value.isSet()) {
System.out.printf("%15s |", value.asSet());
}
if (value.isMap()) {
System.out.printf("%15s |", value.asMap());
}
}
System.out.println();
}
}
} 再贴上报错信息 |
Nebula Client 2.0.1 and master branch has fixed this NPE bug. |
nebula版本: 2.0.1
客户端版本:2.0.0
使用代码:
The text was updated successfully, but these errors were encountered: