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

Upgrading 0.7.0 -> 0.8.0 errors #106

Closed
edeandrea opened this issue Aug 28, 2024 · 4 comments
Closed

Upgrading 0.7.0 -> 0.8.0 errors #106

edeandrea opened this issue Aug 28, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@edeandrea
Copy link
Contributor

Proposal

I updated my application from 0.7.0 to 0.8.0 and my tests now fail. I didn't make any changes in my project other than upgrading the version of the wiremock-grpc dependency.

java.lang.reflect.InvocationTargetException
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
	at io.quarkus.test.common.TestResourceManager.buildTestResourceEntry(TestResourceManager.java:259)
	... 8 more
Caused by: java.lang.NoClassDefFoundError: io/grpc/protobuf/services/ProtoReflectionServiceV1
	at org.wiremock.grpc.internal.GrpcFilter.buildServices(GrpcFilter.java:137)
	at org.wiremock.grpc.internal.GrpcFilter.loadFileDescriptors(GrpcFilter.java:56)
	at org.wiremock.grpc.internal.GrpcHttpServerFactory.loadFileDescriptors(GrpcHttpServerFactory.java:71)
	at org.wiremock.grpc.internal.GrpcHttpServerFactory$1.decorateMockServiceContextBeforeConfig(GrpcHttpServerFactory.java:90)
	at com.github.tomakehurst.wiremock.jetty11.Jetty11HttpServer.addMockServiceContext(Jetty11HttpServer.java:250)
	at com.github.tomakehurst.wiremock.jetty11.Jetty11HttpServer.createHandler(Jetty11HttpServer.java:199)
	at com.github.tomakehurst.wiremock.jetty.JettyHttpServer.<init>(JettyHttpServer.java:100)
	at com.github.tomakehurst.wiremock.jetty11.Jetty11HttpServer.<init>(Jetty11HttpServer.java:76)
	at org.wiremock.grpc.internal.GrpcHttpServerFactory$1.<init>(GrpcHttpServerFactory.java:84)
	at org.wiremock.grpc.internal.GrpcHttpServerFactory.buildHttpServer(GrpcHttpServerFactory.java:84)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:81)
	at io.quarkus.sample.superheroes.fight.LocationsWiremockGrpcServerResource.<init>(LocationsWiremockGrpcServerResource.java:29)
	... 11 more
Caused by: java.lang.ClassNotFoundException: io.grpc.protobuf.services.ProtoReflectionServiceV1
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:561)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:509)
	... 23 more

Reproduction steps

See quarkusio/quarkus-super-heroes#1160 and https://github.com/quarkusio/quarkus-super-heroes/actions/runs/10578222706/job/29307872256?pr=1160

Test classes: https://github.com/quarkusio/quarkus-super-heroes/blob/main/rest-fights/src/test/java/io/quarkus/sample/superheroes/fight/client/LocationClientTests.java and https://github.com/quarkusio/quarkus-super-heroes/blob/main/rest-fights/src/test/java/io/quarkus/sample/superheroes/fight/LocationsWiremockGrpcServerResource.java

  1. Clone https://github.com/quarkusio/quarkus-super-heroes
  2. gh pr checkout 1160
  3. cd rest-fights
  4. ./mvnw clean test -Dtest= LocationClientTests

References

No response

@leeturner
Copy link
Collaborator

Hi @edeandrea Many thanks for posting the issue. This looks like we have bumped a version of our dependencies to one higher than the version Quarkus is using. It looks like Quarkus is using 1.65.1 of io.grpc.grpc-services and the WireMock gRPC extension is using the latest (1.66.0)

Do you know if Quarkus are planning on upgrading the gRPC services dependency ? This should fix the issue. Adding a dependency override in the rest-flights pom allows all the tests to pass:

<dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-services</artifactId>
      <version>1.66.0</version>
</dependency>

Other than that, we could try using the standalone version of wiremock-grpc-extension but I would need to look into this further.

@edeandrea
Copy link
Contributor Author

Thank you @leeturner for looking into this. I will check on the quarkus side and see what the plans are

@edeandrea
Copy link
Contributor Author

I started a conversation about this here: https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/io.2Egrpc.3Agrpc-services.20versioning.3F

@edeandrea
Copy link
Contributor Author

I can verify that updating the version works as expected, so I'll go ahead and close this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants