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

consumer is incompatible with grpc-protobuf version 1.59.0 #1816

Closed
austin226 opened this issue Aug 16, 2024 · 6 comments
Closed

consumer is incompatible with grpc-protobuf version 1.59.0 #1816

austin226 opened this issue Aug 16, 2024 · 6 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@austin226
Copy link

austin226 commented Aug 16, 2024

When using:

  • pact-consumer 4.6.14
  • pact-driver core 0.4.2
  • grpc 1.59.0
  • au.com.dius.pact.consumer.model.MockProviderConfig with transportRegistryEntry = "protobuf/transport/grpc"

the following error occurs:

java.lang.NoClassDefFoundError: io/grpc/internal/AbstractManagedChannelImplBuilder
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
	at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Unknown Source)
	at io.grpc.ManagedChannelRegistry.getHardCodedClasses(ManagedChannelRegistry.java:142)
	at io.grpc.ManagedChannelRegistry.getDefaultRegistry(ManagedChannelRegistry.java:103)
	at io.grpc.ManagedChannelProvider.provider(ManagedChannelProvider.java:43)
	at io.grpc.ManagedChannelBuilder.forTarget(ManagedChannelBuilder.java:86)
	at io.pact.plugins.jvm.core.DefaultPluginManager.tryInitPlugin(PluginManager.kt:884)
	at io.pact.plugins.jvm.core.DefaultPluginManager.initialisePlugin(PluginManager.kt:866)
	at io.pact.plugins.jvm.core.DefaultPluginManager.loadPlugin(PluginManager.kt:419)
	at au.com.dius.pact.consumer.dsl.PactBuilder.usingPlugin(PactBuilder.kt:113)

Additionally,

Did not find an entry for 'protobuf/transport/grpc' in the plugin registry
au.com.dius.pact.consumer.InvalidMockServerRegistryEntry: Did not find an entry for 'protobuf/transport/grpc' in the plugin registry
	at app//au.com.dius.pact.consumer.PluginMockServer.start(PluginMockServer.kt:41)
	at app//au.com.dius.pact.consumer.BaseMockServer.runAndWritePact(MockHttpServer.kt:141)
@austin226
Copy link
Author

May depend on core changes - pact-foundation/pact-plugins#72

@austin226 austin226 changed the title consumer is incompatible with grpc version 1.59.0 consumer is incompatible with grpc-protobuf version 1.59.0 Aug 19, 2024
@rholshausen
Copy link
Contributor

Looks like that refactor upgraded gRPC libs from 1.56.1 to 1.64.0, and 1.59.0 has a breaking change notice https://github.com/grpc/grpc-java/releases/tag/v1.59.0

You could try add an exclusion on pact-driver core 0.4.2 and then add pact-driver core 0.4.1 as a dependency

@rholshausen
Copy link
Contributor

Oh, wait, that refactor has not been released yet. Would that fix your issue (upgrading gRPC libs to 1.64)?

@austin226
Copy link
Author

I see pact driver 0.5.0 was released - matching grpc libs to 1.66 here might fix the issue

@rholshausen rholshausen added the bug Indicates an unexpected problem or unintended behavior label Aug 26, 2024
@rholshausen
Copy link
Contributor

4.6.14 and 4.5.13 have been released which use pact driver 0.5.1

@austin226
Copy link
Author

Upgrading to 4.6.14 solved my issue - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants