temporalio / sdk-java

Temporal Java SDK
https://temporal.io
Apache License 2.0
199 stars 134 forks source link

NoClassDefFoundError: com/google/protobuf/GeneratedMessageV3 | Spring 3.3.1 #2128

Open Lavmee opened 4 days ago

Lavmee commented 4 days ago

Expected Behavior

WorkflowServiceStubs Bean is created.

Actual Behavior

Factory method 'workflowServiceStubs' threw exception with message: com/google/protobuf/GeneratedMessageV3 2024-06-26T12:51:09.185951139Z at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:177) ~[spring-beans-6.1.10.jar!/:6.1.10] 2024-06-26T12:51:09.185951972Z at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:644) ~[spring-beans-6.1.10.jar!/:6.1.10] 2024-06-26T12:51:09.185952764Z ... 68 common frames omitted 2024-06-26T12:51:09.185953389Z Caused by: java.lang.NoClassDefFoundError: com/google/protobuf/GeneratedMessageV3

Steps to Reproduce the Problem

  1. Spring version 3.3.1 & Temporal version 1.24.0
  2. Create workflowServiceStubs Bean
    @Bean
    fun workflowServiceStubs(): WorkflowServiceStubs = WorkflowServiceStubs.newServiceStubs(
        WorkflowServiceStubsOptions {
            setTarget(temporalProperties.connectionTarget)
        }
    )

Specifications

Quinn-With-Two-Ns commented 4 days ago

What version of protobuf are you using?

Lavmee commented 4 days ago

What version of protobuf are you using?

I found the problem. I use Temporal SDK together with the DGS framework, which uses protobuf version 4.26.1

Quinn-With-Two-Ns commented 4 days ago

Yes protobuf 4.26 is know to be problematic with grpc-java