GraphFactory не может найти конфигурацию свойства gremlin.graph

Резюме

При попытке запустить сервер gremlin с ошибкой origindb GraphFactory message: GraphFactory could not find [org.apache.tinkerpop.gremlin.orientdb.OrientEmbeddedFactory] я получил

Подробно

Я использую конфигурацию ниже

Гремлин: apache-tinkerpop-gremlin-server-3.3.1

Orientdb: orientdb-tp3-3.0.2

для загрузки файлов jar используйте bin/gremlin-server.sh -i com.orientechnologies orientdb-gremlin 3.0.2

gremlinpython: 3.3.0

файл gremlin-server-orientdb.yaml

host: localhost
port: 8182
scriptEvaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
  graph : conf/orientdb-empty.properties
}
scriptEngines: {
  gremlin-groovy: {
    plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.orientdb.jsr223.OrientDBGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
               org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [../config/demodb.groovy]}}}}
serializers:
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.orientdb.io.OrientIoRegistry] }}             # application/vnd.gremlin-v3.0+gryo
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                       # application/vnd.gremlin-v3.0+gryo-stringd
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.orientdb.io.OrientIoRegistry] }}         # application/json
processors:
  - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
  - { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}
metrics: {
  consoleReporter: {enabled: true, interval: 180000},
  csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
  jmxReporter: {enabled: true},
  slf4jReporter: {enabled: true, interval: 180000}}
strictTransactionManagement: false
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536
authentication: {
  authenticator: com.orientechnologies.tinkerpop.server.auth.OGremlinServerAuthenticator
    }
ssl: {
  enabled: false} 

файл orientdb-empty.properties

gremlin.graph=org.apache.tinkerpop.gremlin.orientdb.OrientEmbeddedFactory

также пробовал с этим

gremlin.graph=org.apache.tinkerpop.gremlin.orientdb.OrientGraph

stacktrace

admin-12@admin:~/Documents/apache-tinkerpop-gremlin-server-3.3.1/bin$ ./gremlin-server.sh conf/gremlin-server-orientdb.yaml
[INFO] GremlinServer - 
         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----

[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-orientdb.yaml
[INFO] MetricManager - Configured Metrics ConsoleReporter configured with report interval=180000ms
[INFO] MetricManager - Configured Metrics CsvReporter configured with report interval=180000ms to fileName=/tmp/gremlin-server-metrics.csv
[INFO] MetricManager - Configured Metrics JmxReporter configured with domain= and agentId=
[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
[WARN] DefaultGraphManager - Graph [graph] configured at [conf/orientdb-empty.properties] could not be instantiated and will not be available in Gremlin Server.  GraphFactory message: GraphFactory could not find [org.apache.tinkerpop.gremlin.orientdb.OrientEmbeddedFactory] - Ensure that the jar is in the classpath
java.lang.RuntimeException: GraphFactory could not find [org.apache.tinkerpop.gremlin.orientdb.OrientEmbeddedFactory] - Ensure that the jar is in the classpath
    at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:63)
    at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:104)
    at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.lambda$new$0(DefaultGraphManager.java:57)
    at java.util.LinkedHashMap$LinkedEntrySet.forEach(LinkedHashMap.java:671)
    at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.<init>(DefaultGraphManager.java:55)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:80)
    at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:111)
    at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:325)
[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool.  Threads in pool named with pattern gremlin-*
Exception in thread "main" java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
    at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.initializeGremlinScriptEngineManager(GremlinExecutor.java:448)
    at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.<init>(GremlinExecutor.java:105)
    at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.<init>(GremlinExecutor.java:74)
    at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor$Builder.create(GremlinExecutor.java:590)
    at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:128)
    at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:111)
    at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:325

Обновлено

[WARN] Slf4JLogger - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.NullPointerException
    at com.orientechnologies.tinkerpop.server.auth.OGremlinServerAuthenticator.authenticate(OGremlinServerAuthenticator.java:34)
    at org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator$PlainTextSaslAuthenticator.getAuthenticatedUser(SimpleAuthenticator.java:143)
    at org.apache.tinkerpop.gremlin.server.handler.SaslAuthenticationHandler.channelRead(SaslAuthenticationHandler.java:103)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)

person Akshay    schedule 19.06.2018    source источник


Ответы (1)


Вы смешиваете много разных версий, поэтому сложно сказать, какая из них сработает. Прежде всего, TinkerPop рекомендует попробовать сопоставить версии сервера с версией клиента. Это означает, что если вы используете 3.3.1 на сервере, вам следует попробовать использовать 3.3.1 клиента (в вашем случае gremlin-python). Затем вы используете orientdb-gremlin с 3.0.2, который, похоже, привязан к TinkerPop 3.3.0,

https://github.com/orientechnologies/orientdb-gremlin/blob/3.0.2/driver/pom.xml

Это означает, что для достижения наилучших результатов вам, вероятно, следует использовать 3.3.0 на сервере Gremlin и gremlin-python. Теперь, когда я упоминаю все это о «совпадающих версиях», я скажу, что можно смешивать версии, но сопоставление поможет ограничить то, что может пойти не так, поскольку вы только начинаете, поэтому я бы посоветовал вам начать с этого .

Что касается вашей ошибки, я думаю, вы установили неправильные зависимости. Вы должны были сделать:

bin/gremlin-server.sh -i com.orientechnologies orientdb-gremlin-server 3.0.2

поскольку orientdb-gremlin-server внесет OrientEmbeddedFactory, а также orientdb-gremlin зависимости. Я также думаю, что в вашем orientdb-empty.properties файле отсутствуют некоторые параметры конфигурации - посмотрите, что по умолчанию, а что нет здесь.

person stephen mallette    schedule 19.06.2018
comment
загрузил сервер gremlin 3.3.0, затем запустил сервер. он выполнил какой-то процесс, а затем застрял. Я ждал 10-15 минут, но ответа не получил. Я добавил скриншот - person Akshay; 19.06.2018
comment
как вы тестировали соединение с сервером gremlin? - person stephen mallette; 19.06.2018
comment
Я решил проблему, и теперь все работает нормально. Я установил зависимости с помощью этой команды bin / gremlin-server.sh -i com.orientechnologies orientdb-gremlin 3.0.2 - person Akshay; 20.06.2018