0

I have a Java Spring Boot application that connects to an Amazon Neptune graph database running on engine version 1.1.1.0.

After upgrading the gremlin-driver and TinkerPop dependencies to 3.5.2 from 3.4.6 (working on this version), the application can no longer make a connection to the graph database on AWS and it throws this exception

io.netty.channel.ChannelInitializer : Failed to initialize a channel. Closing: [id: 0xf213a752]ecs/XYZ
   

java.lang.NoSuchMethodError: io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13.<init>(Ljava/net/URI;Lio/netty/handler/codec/http/websocketx/WebSocketVersion;Ljava/lang/String;ZLio/netty/handler/codec/http/HttpHeaders;IZZJ)V

I haven't made any changes with the builder besides the code-breaking change with one of the imports and the method name change. Did I miss something in this update?

This is the builder configuration that I am using from 3.4.6

        Cluster.Builder builder = Cluster.build();
        builder.addContactPoints(gremlinProperties.getContactPoints());
        builder.port(gremlinProperties.getPort());
        builder.nioPoolSize(gremlinProperties.getNioPoolSize());
        builder.workerPoolSize(gremlinProperties.getWorkerPoolSize());
        builder.minConnectionPoolSize(gremlinProperties.getMinConnectionPoolSize());
        builder.maxConnectionPoolSize(gremlinProperties.getMaxConnectionPoolSize());
        builder.minSimultaneousUsagePerConnection(gremlinProperties.getMinSimultaneousUsagePerConnection());
        builder.maxSimultaneousUsagePerConnection(gremlinProperties.getMaxSimultaneousUsagePerConnection());
        builder.maxInProcessPerConnection(gremlinProperties.getMaxInProcessPerConnection());
        builder.minInProcessPerConnection(gremlinProperties.getMinInProcessPerConnection());
        builder.maxWaitForConnection(gremlinProperties.getMaxWaitForConnection());
        builder.maxWaitForClose(gremlinProperties.getMaxWaitForSessionClose());
        builder.maxContentLength(gremlinProperties.getMaxContentLength());
        builder.reconnectInterval(gremlinProperties.getReconnectInterval());
        builder.resultIterationBatchSize(gremlinProperties.getResultIterationBatchSize());
                builder.keepAliveInterval(gremlinProperties.getKeepAliveInterval());
        builder.channelizer(Channelizer.WebSocketChannelizer.class);
        builder.enableSsl(gremlinProperties.isEnableSsl());

        return builder.create();

The values are extracted from a property file

ReiSchneider
  • 185
  • 1
  • 12
  • are you using this sigv4 library: https://github.com/aws/amazon-neptune-gremlin-java-sigv4 ? – stephen mallette Oct 24 '22 at 15:09
  • @stephenmallette I did. I tried using both amazon-neptune-sigv4-signer and amazon-neptune-gremlin-java-sigv4 as per documentation but to no avail. – ReiSchneider Oct 24 '22 at 19:22
  • could you please update your question to include the code you are using to setup the driver after your upgrade? – stephen mallette Oct 25 '22 at 16:17
  • @stephenmallette Added the code snippet for the builder. I have tried the approaches using the Sig4 both for the channelizer and the interceptor approach but none worked – ReiSchneider Oct 26 '22 at 02:00
  • if you are going to 3.5.x then you should not be using the `WebSocketChannelizer` and should probably wholly remove any dependency on `amazon-neptune-gremlin-java-sigv4`. Could you please share the code you are using for the interceptor approach? – stephen mallette Oct 26 '22 at 11:15
  • @stephenmallette I used the one in here https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth-connecting-gremlin-java.html – ReiSchneider Oct 26 '22 at 16:27

1 Answers1

0

Since the code that handles the gremlin connection and queries is located in a dependency jar project, the netty.version declared in the main project using that jars overrides the netty.io version that is used in the said jar project. I just have to declare a netty.version property in the main project pom so that it matches the netty version used in the dependency.

ReiSchneider
  • 185
  • 1
  • 12