Need help in remote graph traversal

1,041 views
Skip to first unread message

Ajay Srivastava

unread,
Oct 13, 2017, 7:57:57 AM10/13/17
to JanusGraph users
Hi,

I am trying to add a vertex using remote graph traversal and getting following error -

scala> val graph = EmptyGraph.instance().traversal().withRemote("/root/janusgraph-0.1.1-hadoop2/conf/janusgraph-remote.properties")
graph: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource = graphtraversalsource[emptygraph[empty], standard]

scala> graph.addV("Concept").property("ABC", 12).head
17:17:39,585  INFO Connection:121 - Created new connection for ws://dev-3:8182/gremlin
17:17:39,592  INFO Connection:121 - Created new connection for ws://dev-3:8182/gremlin
17:17:39,592  INFO ConnectionPool:106 - Opening connection pool on Host{address=ajay-dev-3/192.168.168.171:8182, hostUri=ws://ajay-dev-3:8182/gremlin} with core size of 2
java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.tinkerpop.gremlin.process.remote.traversal.DefaultRemoteTraverser
  at org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteTraversal$TraverserIterator.next(DriverRemoteTraversal.java:138)
  at org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteTraversal$TraverserIterator.next(DriverRemoteTraversal.java:123)
  at org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteTraversal.nextTraverser(DriverRemoteTraversal.java:104)
  at org.apache.tinkerpop.gremlin.process.remote.traversal.step.map.RemoteStep.processNextStart(RemoteStep.java:62)
  at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:128)
  at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:38)
  at org.apache.tinkerpop.gremlin.process.traversal.Traversal.fill(Traversal.java:154)
  at org.apache.tinkerpop.gremlin.process.traversal.Traversal.toList(Traversal.java:111)
  at gremlin.scala.GremlinScala.toList(GremlinScala.scala:30)
  at gremlin.scala.GremlinScala.head(GremlinScala.scala:39)
  ... 32 elided

scala> graph.addV().head
java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.tinkerpop.gremlin.process.remote.traversal.DefaultRemoteTraverser
  at org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteTraversal$TraverserIterator.next(DriverRemoteTraversal.java:138)



What could be the reason for above exception ?


Regards,
Ajay

Robert Dale

unread,
Oct 13, 2017, 1:23:22 PM10/13/17
to Ajay Srivastava, JanusGraph users
Looks like one side of your serializers is set to `serializeResultToString: true`. 




Robert Dale

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/BE07EF93-33A4-4723-B128-3930AB9D9732%40guavus.com.
For more options, visit https://groups.google.com/d/optout.

Ajay Srivastava

unread,
Oct 16, 2017, 5:20:19 AM10/16/17
to Robert Dale, JanusGraph users
Thanks Robert.
I corrected that and problem got resolved.


Regards,
Ajay

To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/CABed_4o34_J9B_vaRO7rg_r7s6OB2MSy%2BBC%2B39fqjjME89qu%2Bw%40mail.gmail.com.

adrielv...@gmail.com

unread,
Nov 30, 2017, 2:16:03 PM11/30/17
to JanusGraph users
I'm in a similiar position as you; however, my properties files seems to be incorrect. Do you mind posting a sample of your janusgraph-remote.properties?

Ajay Srivastava

unread,
Dec 1, 2017, 12:22:21 AM12/1/17
to adrielv...@gmail.com, JanusGraph users
Hi,

These are files from my old setup. Hope that it’s useful for you. I was doing POC of graph dbs and have started working on another project now.

[root@ajay-dev-1 conf]# cat janusgraph-remote.properties
gremlin.remote.remoteConnectionClass=org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection
# cluster file has the remote server configuration
gremlin.remote.driver.clusterFile=/root/janusgraph-0.1.1-hadoop2/conf/remote-objects.yaml
# source name is the global graph traversal source defined on the server
gremlin.remote.driver.sourceName=g

[root@ajay-dev-1 conf]# cat remote-objects.yaml
hosts: [ajay-dev-3]
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}


[root@ajay-dev-1 conf]# cat remote-objects.yaml
hosts: [ajay-dev-3]
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}


[root@ajay-dev-1 conf]# cat gremlin-server/socket-gremlin-server.yaml 
host: ajay-dev-3
port: 8182
scriptEvaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
  graph: conf/gremlin-server/socket-janusgraph-hbase-server.properties
  olapgraph: conf/hadoop-graph/read-hbase.properties }
plugins:
  - janusgraph.imports
scriptEngines: {
  gremlin-groovy: {
    imports: [java.lang.Math],
    staticImports: [java.lang.Math.PI],
    scripts: [scripts/empty-sample.groovy]}}
serializers:
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
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},
  gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
  graphiteReporter: {enabled: false, interval: 180000}}
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536
ssl: {
  enabled: false}


Regards,
Ajay


--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages