Gremlin driver exception

351 views
Skip to first unread message

Sudha Subramanian

unread,
Feb 4, 2016, 12:47:52 AM2/4/16
to Aurelius
Hi,

I'm using gremlin-driver to execute some methods defined in a groovy file. 

In my maven pom file I have gremlin-driver:3.1.0-incubating defined as dependency.  

I create the client as follows and execute a method. I get an exception ( Exception-I attached below). If I include titan-core:1.0.0 ( in addition to gremlin-driver) in my pom file, I get a class not found exception ( org.apache.tinkerpop.shaded.jackson.core.type.TypeReference). I even tried with gremlin-driver:3.2.0-SNAPSHOT but get into some other exception.

Can someone please tell me what are the right dependencies I need to include in my pom file and am I initializing the client correctly? 

 Cluster.Builder builder = Cluster.build();


 builder.addContactPoint("localhost");


 builder.minConnectionPoolSize(10);


 builder.maxConnectionPoolSize(50);


 cluster = builder.create();

 client.submit("get_or_create_user(g, userName, email, createdTime)", parameters);


Exception-I


Exception in thread "main" java.lang.RuntimeException: java.util.concurrent.ExecutionException: io.netty.handler.codec.EncoderException: WebSocketGremlinRequestEncoder must produce at least one message.


        at org.apache.tinkerpop.gremlin.driver.Client.submit(Client.java:146)


        at com.beaconpole.infrastructure.GremlinDriverTest.testGetOrCreateUser(GremlinDriverTest.java:33)


        at com.beaconpole.infrastructure.GremlinDriverTest.main(GremlinDriverTest.java:38)


Caused by: java.util.concurrent.ExecutionException: io.netty.handler.codec.EncoderException: WebSocketGremlinRequestEncoder must produce at least one message.


        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)


        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1887)


        at org.apache.tinkerpop.gremlin.driver.Client.submit(Client.java:144)


        ... 2 more


Caused by: io.netty.handler.codec.EncoderException: WebSocketGremlinRequestEncoder must produce at least one message.


        at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:98)


        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:633)


        at io.netty.channel.AbstractChannelHandlerContext.access$1900(AbstractChannelHandlerContext.java:32)


        at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:908)


        at io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:960)


        at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:893)


        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357)


        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)


        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)


        at java.lang.Thread.run(Thread.java:745)


 

Stephen Mallette

unread,
Feb 4, 2016, 3:33:30 PM2/4/16
to Aurelius
You are mixing and matching versions. TinkerPop 3.1.x won't work with Titan 1.0.0 as it requires TinkerPop 3.0.x.  If you want to work with the latest TinkerPop stuff you'll need to build the titan11 branch:

mvn clean install -DskipTests=true -Paurelius-release -Dgpg.skip=true

the zip distributions will be in the titan-dist/target directory.

--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/3b90aa61-9e99-4703-8887-b14a05ef240e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sudha Subramanian

unread,
Feb 4, 2016, 3:37:30 PM2/4/16
to Aurelius
The following pom dependencies works for me.  When I used tinkerpop rexster client, the only dependency I had was rexter-protocol. I had a serialization library conflict with apache storm when I had titan included inside my module. I'm not sure if I will run into the same issue this time as I'm having to include titan now with gremlin-driver. But I tested out in a separate test client and it seems to work fine.



        <dependency>

                   <groupId>com.thinkaurelius.titan</groupId>

                     <artifactId>titan-core</artifactId>

                    <version>1.0.0</version>

                       <exclusions>

                           <exclusion>

                                    <groupId>org.apache.tinkerpop</groupId>

                                <artifactId>gremlin-driver</artifactId>

                        </exclusion>

                   </exclusions>

          </dependency>


       

               <dependency>

                   <groupId>org.apache.tinkerpop</groupId>

                <artifactId>gremlin-driver</artifactId>

                <version>3.2.0-SNAPSHOT</version>

              </dependency>


                <dependency>

                   <groupId>org.apache.tinkerpop</groupId>

                <artifactId>gremlin-core</artifactId>

                  <version>3.2.0-SNAPSHOT</version>

              </dependency>


                <dependency>

                   <groupId>org.apache.tinkerpop</groupId>

                <artifactId>gremlin-shaded</artifactId>

                <version>3.2.0-SNAPSHOT</version>

               </dependency>


Sudha Subramanian

unread,
Feb 4, 2016, 3:40:39 PM2/4/16
to Aurelius
Thanks Stephen. I was trying out some combinations in the meanwhile and got 3.2 to work by excluding titan's tinkerpop dependency. I'm not sure if I will run into other issues. So, I will go back and use tinkerpop 3.0 and test it out.

Thanks again. 

Stephen Mallette

unread,
Feb 4, 2016, 3:41:49 PM2/4/16
to Aurelius
Those versions haven't been tested together.  Just be aware of that.  You might run into compatibility issues somewhere along the line.

--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.

Sudha Subramanian

unread,
Feb 4, 2016, 5:21:57 PM2/4/16
to aureliu...@googlegroups.com
Thanks Stephen. I reverted back to tinkerpop 3.0.2-incubating and everything works fine.

--
You received this message because you are subscribed to a topic in the Google Groups "Aurelius" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/aureliusgraphs/kaJnurrPsNE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/CAA-H43--dT-Pp86RX0x-huStnq6XVjyySCiGnQYLfFva2t9DaA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages