运行JanusGraph Gremlin控制台时出错

时间:2018-02-08 10:25:58

标签: gremlin janusgraph

我按照此处提到的步骤进行操作:http://docs.janusgraph.org/latest/getting-started.html 运行命令时出错:Logger.getLogger(<your-class>.class.getName()).log(Level.SEVERE, null, ex);

错误追踪:

bin/gremlin.sh

我正在使用以下java版本:

Exception in thread "main" java.io.UnsupportedEncodingException: UTF-8i
    at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:61)
    at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:100)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:231)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:221)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:213)
    at org.codehaus.groovy.tools.shell.PatchedConsoleReader.<init>(PatchedConsoleReader.groovy:32)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.<init>(InteractiveShellRunner.groovy:50)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
    at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:118)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
    at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:478)

有谁能告诉我如何避免这个错误并开始使用JanusGraph?

1 个答案:

答案 0 :(得分:0)

从堆栈跟踪中,看起来编码设置为UTF-8i,这不是有效值。有关典型值,请参阅StandardCharsets。检查您的LC_CTYPE环境变量或JAVA_OPTIONS,看看它是否会覆盖input.encodingfile.encoding

例如,这会重新创建上面的堆栈跟踪:

$ export JAVA_OPTIONS=-Dinput.encoding=UTF-8i
$ bin/gremlin.sh

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
Exception in thread "main" java.io.UnsupportedEncodingException: UTF-8i
    at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:61)
    at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:100)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:231)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:221)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:213)
    etc...

取消设置JAVA_OPTIONS变量使其再次起作用:

$ unset JAVA_OPTIONS
$ bin/gremlin.sh

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: janusgraph.imports
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.hadoop
plugin activated: tinkerpop.spark
plugin activated: tinkerpop.tinkergraph
gremlin>