org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Invalid OpProcessor requested [Req

衡翰藻
2023-12-01

org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Invalid OpProcessor requested [RequestMessage{,

第一种方式没问题

Client connection = GremlinUtils.getConnection();
        String insertSql = "g.V('111').outE('zzz').inV().valueMap(true)";
        ResultSet results = connection.submit( insertSql);
        List<Result> joins = results.all().join();
        //创建返回结果
        if (joins != null && joins.size() > 0) {
            for (int i = 0; i < joins.size(); i++) {
                Result result = joins.get( i );
                System.out.println(result.toString());
            }
        }

第二种方式出现问题

    String insertSql1 = "g.V(vertexId).outE('groupToEnterpriseDown').inV().valueMap(true,'id','label','status','enterpriseName','formatName')";
    // 2. 配置请求参数,包括超时时间,bindings参数化
    RequestOptions.Builder options = RequestOptions.build().timeout( 300000 );
    options.addParameter( "vertexId", "groupcorp:91110108551385082Q" );
    options.addParameter( "label", "groupToEnterpriseDown" );
    ResultSet results11 = connection.submit( insertSql1, options.create() );
    List<Result> join = results11.all().join();
    //创建返回结果
    if (join != null && join.size() > 0) {
        for (int i = 0; i < join.size(); i++) {
            Result result = join.get( i );
            System.out.println(result.toString());
        }
    }

System.out.println("结束");

解决方案是 去掉 把label的参数去掉拼接字符串 就可以解决

    options.addParameter( "label", "groupToEnterpriseDown" );
 类似资料: