Hi,
While integrating TTN Java SDK, I am getting an exception related to grpc and netty jar versions while fetching the Application handler from TTN discovery server.
Below is the error stack trace for the exception,
java.lang.NoClassDefFoundError: Could not initialize class io.grpc.netty.NettyClientHandler
at io.grpc.netty.NettyClientTransport.start(NettyClientTransport.java:174)
at io.grpc.internal.ForwardingConnectionClientTransport.start(ForwardingConnectionClientTransport.java:44)
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:217)
at io.grpc.internal.InternalSubchannel.obtainActiveTransport(InternalSubchannel.java:190)
at io.grpc.internal.ManagedChannelImpl$SubchannelImplImpl.obtainActiveTransport(ManagedChannelImpl.java:827)
at io.grpc.internal.GrpcUtil.getTransportFromPickResult(GrpcUtil.java:592)
at io.grpc.internal.DelayedClientTransport.reprocess(DelayedClientTransport.java:295)
at io.grpc.internal.ManagedChannelImpl$LbHelperImpl$5.run(ManagedChannelImpl.java:733)
at io.grpc.internal.ChannelExecutor.drain(ChannelExecutor.java:87)
at io.grpc.internal.ManagedChannelImpl$LbHelperImpl.runSerialized(ManagedChannelImpl.java:724)
at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl.onAddresses(ManagedChannelImpl.java:773)
at io.grpc.internal.DnsNameResolver$1.run(DnsNameResolver.java:191)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
I tried to add exclusion of dependencies for both the packages and also used shading jar which includes reference of both packages. Following exception received,
java.lang.NoSuchMethodError: io.netty.util.AsciiString.cached(Ljava/lang/String;)Lio/netty/util/AsciiString;
at io.netty.handler.codec.http2.Http2Headers$PseudoHeaderName.<init>(Http2Headers.java:74)
at io.netty.handler.codec.http2.Http2Headers$PseudoHeaderName.<clinit>(Http2Headers.java:38)
at io.netty.handler.codec.http2.ReadOnlyHttp2Headers.serverHeaders(ReadOnlyHttp2Headers.java:110)
at io.netty.handler.codec.http2.Http2ConnectionHandler.<clinit>(Http2ConnectionHandler.java:71)
at io.grpc.netty.NettyClientTransport.start(NettyClientTransport.java:174)
at io.grpc.internal.ForwardingConnectionClientTransport.start(ForwardingConnectionClientTransport.java:44)
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:217)
at io.grpc.internal.InternalSubchannel.obtainActiveTransport(InternalSubchannel.java:190)
at io.grpc.internal.ManagedChannelImpl$SubchannelImplImpl.obtainActiveTransport(ManagedChannelImpl.java:827)
at io.grpc.internal.GrpcUtil.getTransportFromPickResult(GrpcUtil.java:592)
at io.grpc.internal.DelayedClientTransport.reprocess(DelayedClientTransport.java:295)
at io.grpc.internal.ManagedChannelImpl$LbHelperImpl$5.run(ManagedChannelImpl.java:733)
at io.grpc.internal.ChannelExecutor.drain(ChannelExecutor.java:87)
at io.grpc.internal.ManagedChannelImpl$LbHelperImpl.runSerialized(ManagedChannelImpl.java:724)
at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl.onAddresses(ManagedChannelImpl.java:773)
at io.grpc.internal.DnsNameResolver$1.run(DnsNameResolver.java:191)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Currently I am using 2.1.3 version of TTN account and management SDK in my configuration file,
org.thethingsnetwork
account
2.1.3
org.thethingsnetwork
management
2.1.3
Thanks.