incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

使用java client更新边的属性,报错

Open learn-xujun opened this issue 7 years ago • 3 comments

Expected behavior 期望表现

使用java代码更新边的属性: Edge edges = hugeClient.graph().getEdge("S10:[email protected]>41>>S11:2811").property("LAST_1_DAY_TOTAL",30); 期望能更新成功,在studio里面使用如下语句更新边的属性是ok的: g.E('S10:[email protected]>41>>S11:2811').property('LAST_15_DAY_TOTAL',80)

Actual behavior 实际表现

提示边id中的“>”有问题,错误信息如下:

Exception in thread "main" null: Grizzly 2.3.28

Internal Server Error
java.net.URISyntaxException: Illegal character in path at index 87: http://xxxxxx/graphs/hugegraph/graph/edges/S10:[email protected]>41>>S11:2811
     1: org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.getRequestUri(GrizzlyHttpContainer.java:491)
2: org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:366)
3: org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224)
4: org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
5: org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
6: java.lang.Thread.run(Thread.java:745)
Root Cause: java.net.URISyntaxException: Illegal character in path at index 87: http://xxxxxx/graphs/hugegraph/graph/edges/S10:[email protected]>41>>S11:2811
     1: java.net.URI$Parser.fail(URI.java:2848)
2: java.net.URI$Parser.checkChars(URI.java:3021)
3: java.net.URI$Parser.parseHierarchical(URI.java:3105)
4: java.net.URI$Parser.parse(URI.java:3053)
5: java.net.URI.(URI.java:588)
6: org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.getRequestUri(GrizzlyHttpContainer.java:489)
7: org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:366)
8: org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224)
9: org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
10: org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
... 1 more
Please see the log for more detail.
at com.baidu.hugegraph.exception.ServerException.fromResponse(ServerException.java:44) at com.baidu.hugegraph.client.RestClient.checkStatus(RestClient.java:63) at com.baidu.hugegraph.rest.RestClient.get(RestClient.java:177) at com.baidu.hugegraph.api.graph.EdgeAPI.get(EdgeAPI.java:85) at com.baidu.hugegraph.driver.GraphManager.getEdge(GraphManager.java:187) at com.huawei.SingleExample.main(SingleExample.java:38)

Steps to reproduce the problem 复现步骤

  1. {step 1}
  2. {step 2}
  3. {step 3}

Status of loaded data 数据状态

Vertex/Edge summary 数据量

  • loaded vertices amount: 几百个
  • loaded edges amount: 五六千
  • loaded time: {like 200s}

Vertex/Edge example 数据示例

{type something here...}

Schema(VertexLabel, EdgeLabel, IndexLabel) 元数据结构

{type something here...}

Specifications of environment 环境信息

  • hugegraph version: v0.8.0
  • operating system: centos7.x
  • hugegraph backend: cassandra

求教!

learn-xujun avatar Feb 22 '19 11:02 learn-xujun

@jizhidezhaojun 你用的hugegraph-server和hugegraph-client分别是哪个版本的?还有你可以在postman或restlet中直接请求http://xxxxxx/graphs/hugegraph/graph/edges/S10:[email protected]>41>>S11:2811试试,看有没有报错,比如这样: image

Linary avatar Feb 25 '19 06:02 Linary

感谢回复!找到问题了,我们的hugegraph-server通过nginx代理,问题出在nginx上,前端发出请求对Url进行编码,nginx接收到然后解码,转发给hugegraph-server时没有再次编码引发的问题,已解决!

learn-xujun avatar Mar 05 '19 06:03 learn-xujun

这个问题可以close掉了:)

learn-xujun avatar Mar 05 '19 06:03 learn-xujun