Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractMethodError from gRPC client #11

Closed
robertjli opened this issue Jun 27, 2018 · 4 comments
Closed

AbstractMethodError from gRPC client #11

robertjli opened this issue Jun 27, 2018 · 4 comments

Comments

@robertjli
Copy link

As soon as I add the dependency to my build.gradle file, I see this error when attempting to send a request.

frontend [warn] 2018-06-27 10:59:20 -0400 i.g.i.ManagedChannelImpl - [io.grpc.internal.ManagedChannelImpl-25] Unexpected exception from LoadBalancer
java.lang.AbstractMethodError: io.grpc.okhttp.OkHttpChannelBuilder$OkHttpTransportFactory.newClientTransport(Ljava/net/SocketAddress;Ljava/lang/String;Ljava/lang/String;Lio/grpc/internal/ProxyParameters;)Lio/grpc/internal/ConnectionClientTransport;
        at io.grpc.internal.CallCredentialsApplyingTransportFactory.newClientTransport(CallCredentialsApplyingTransportFactory.java:48)
        at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:209)
        at io.grpc.internal.InternalSubchannel.obtainActiveTransport(InternalSubchannel.java:188)
        at io.grpc.internal.ManagedChannelImpl$SubchannelImpl.requestConnection(ManagedChannelImpl.java:962)
        at io.grpc.util.RoundRobinLoadBalancerFactory$RoundRobinLoadBalancer.handleResolvedAddressGroups(RoundRobinLoadBalancerFactory.java:126)
        at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl$1.run(ManagedChannelImpl.java:868)
        at io.grpc.internal.ChannelExecutor.drain(ChannelExecutor.java:72)
        at io.grpc.internal.ManagedChannelImpl$LbHelperImpl.runSerialized(ManagedChannelImpl.java:834)
        at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl.onAddresses(ManagedChannelImpl.java:860)
        at io.grpc.internal.DnsNameResolver$1.run(DnsNameResolver.java:180)

Any thoughts?

@malafeev
Copy link
Contributor

maybe jar hell? could you check that classpath doesn't have jars with different versions?

@robertjli
Copy link
Author

CLASSPATH is empty. I'm a bit confused because we use netty as our transport layer in gRPC, so I'm not sure why it's requiring an okhttp class.

@malafeev
Copy link
Contributor

@robertjli there is no dependency on okhttp:

/projects/java-grpc$ mvn dependency:tree 
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------< io.opentracing.contrib:opentracing-grpc >---------------
[INFO] Building io.opentracing.contrib:opentracing-grpc 0.0.6-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ opentracing-grpc ---
[INFO] io.opentracing.contrib:opentracing-grpc:jar:0.0.6-SNAPSHOT
[INFO] +- io.opentracing:opentracing-api:jar:0.31.0:compile
[INFO] +- io.opentracing:opentracing-mock:jar:0.31.0:test
[INFO] |  +- io.opentracing:opentracing-noop:jar:0.31.0:test
[INFO] |  \- io.opentracing:opentracing-util:jar:0.31.0:test
[INFO] +- io.opentracing:opentracing-util:test-jar:tests:0.31.0:test
[INFO] +- io.grpc:grpc-core:jar:1.12.0:compile
[INFO] |  +- io.grpc:grpc-context:jar:1.12.0:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.7:compile
[INFO] |  +- com.google.guava:guava:jar:20.0:compile
[INFO] |  +- com.google.errorprone:error_prone_annotations:jar:2.1.2:compile
[INFO] |  +- com.google.code.findbugs:jsr305:jar:3.0.0:compile
[INFO] |  +- io.opencensus:opencensus-api:jar:0.11.0:compile
[INFO] |  \- io.opencensus:opencensus-contrib-grpc-metrics:jar:0.11.0:compile
[INFO] +- io.grpc:grpc-stub:jar:1.12.0:test
[INFO] +- io.grpc:grpc-protobuf:jar:1.12.0:test
[INFO] |  +- com.google.protobuf:protobuf-java:jar:3.5.1:test
[INFO] |  +- com.google.protobuf:protobuf-java-util:jar:3.5.1:test
[INFO] |  +- com.google.api.grpc:proto-google-common-protos:jar:1.0.0:test
[INFO] |  \- io.grpc:grpc-protobuf-lite:jar:1.12.0:test
[INFO] +- io.grpc:grpc-netty:jar:1.12.0:test
[INFO] |  +- io.netty:netty-codec-http2:jar:4.1.22.Final:test (version selected from constraint [4.1.22.Final,4.1.22.Final])
[INFO] |  |  +- io.netty:netty-codec-http:jar:4.1.22.Final:test
[INFO] |  |  |  \- io.netty:netty-codec:jar:4.1.22.Final:test
[INFO] |  |  \- io.netty:netty-handler:jar:4.1.22.Final:test
[INFO] |  |     \- io.netty:netty-buffer:jar:4.1.22.Final:test
[INFO] |  |        \- io.netty:netty-common:jar:4.1.22.Final:test
[INFO] |  \- io.netty:netty-handler-proxy:jar:4.1.22.Final:test
[INFO] |     +- io.netty:netty-transport:jar:4.1.22.Final:test
[INFO] |     |  \- io.netty:netty-resolver:jar:4.1.22.Final:test
[INFO] |     \- io.netty:netty-codec-socks:jar:4.1.22.Final:test
[INFO] +- junit:junit:jar:4.12:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.assertj:assertj-core:jar:3.9.1:test
[INFO] \- org.awaitility:awaitility:jar:3.1.0:test
[INFO]    +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO]    \- org.objenesis:objenesis:jar:2.6:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.694 s
[INFO] Finished at: 2018-06-28T13:49:08+08:00
[INFO] ------------------------------------------------------------------------
/projects/java-grpc$ 

could you attach your build.gradle file?

@robertjli
Copy link
Author

It does seem like this is an issue on our side. Thanks for the help! I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants