# Temporal-sdk java issue with protobuf versioning

**URL:** <https://community.temporal.io/t/temporal-sdk-java-issue-with-protobuf-versioning/13044>\
**Category:** Community Support\
**Created:** [August 2, 2024, 5:01am UTC](https://community.temporal.io/t/temporal-sdk-java-issue-with-protobuf-versioning/13044 "2024-08-02T05:01:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![skg](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/skg/32/5676_2.png) [@skg](https://community.temporal.io/u/skg)\
**Post date:** [August 2, 2024, 5:01am UTC](https://community.temporal.io/t/temporal-sdk-java-issue-with-protobuf-versioning/13044/1 "2024-08-02T05:01:11Z")

</div>

Hi all, I have been running into an issue with protobuf on my classpath during runtime. Specifically, my gradle file has the following:

```auto
implementation("io.temporal:temporal-sdk:1.24.1")
implementation("io.temporal:temporal-kotlin:1.24.1")

```

During runtime, we are getting this error:

```auto
java.lang.NoSuchMethodError: 'boolean com.google.protobuf.Value.hasNullValue()'

```

Taking a closer look, the protobuf library doesn’t have this method until version [3.15](https://www.javadoc.io/doc/com.google.protobuf/protobuf-java/3.15.0/index.html). Using the debugger and reflection I was able to figure out where it was getting this class from to see why it was pulling an older one and I found it was:

```auto
/Users/sg/.gradle/caches/modules-2/files-2.1/io.temporal/temporal-serviceclient/1.24.1/c8d53b8b35e8c1c14941aa0509b01570be21605a/temporal-serviceclient-1.24.1.jar

```

So it seems like com.google.protobuf.Value is included within that jar which I was able to verify locally and on [maven](https://repo1.maven.org/maven2/io/temporal/temporal-serviceclient/1.24.1/) as well. Is there something wrong with the way that I am depending on this? I want to use a newer version of protobuf since it is required for google cloud. I found the temporal-shaded SDK but that says not to use it unless a older version of these libraries is required. Thanks so much!

---

<div class="post-metadata">

**Author:** ![skg](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/skg/32/5676_2.png) [@skg](https://community.temporal.io/u/skg)\
**Post date:** [August 2, 2024, 6:21am UTC](https://community.temporal.io/t/temporal-sdk-java-issue-with-protobuf-versioning/13044/2 "2024-08-02T06:21:27Z")

</div>

Additionally, just for science I tried out the temporal-shaded dependency instead. While it shades the problematic `com.google.protobuf` dependencies it adds classes that are not in `temporal-sdk`. I am not sure why the class list is not the exact same with some shaded. Specifically, it is adding:

```auto
class com.google.longrunning.GetOperationRequest

```

Which is incompatible with google SDK clients that use protobuf lite.

Also, then I took a closer look at the Java SDK. And the protoVersion chosen in the build.gradle is set to 3.22, but I don’t see the expected methods on the classes that should be there in the exported client JAR. The exported JAR seems to expose a version older than that.

---

<div class="post-metadata">

**Author:** ![skg](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/skg/32/5676_2.png) [@skg](https://community.temporal.io/u/skg)\
**Post date:** [August 3, 2024, 7:15am UTC](https://community.temporal.io/t/temporal-sdk-java-issue-with-protobuf-versioning/13044/3 "2024-08-03T07:15:27Z")

</div>

Hi again, wanted to point out one more thing I discovered. While building the temporal-sdk locally, I realized that between version [1.23.1](https://javadoc.io/doc/io.temporal/temporal-serviceclient/1.23.1/index.html) and [1.23.2](https://javadoc.io/doc/io.temporal/temporal-serviceclient/1.23.2/index.html), the problematic `com.google.api` export was added. The `build.gradle` within the temporal-serviceclient package had no changes so I am not sure if it was intentional. 1.23.2 was released only a few months ago and I didn’t see anything in the release notes so it might have been inadvertent.

---

<div class="post-metadata">

**Author:** ![Duzhinsky](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@Duzhinsky](https://community.temporal.io/u/Duzhinsky)\
**Post date:** [August 4, 2024, 9:49am UTC](https://community.temporal.io/t/temporal-sdk-java-issue-with-protobuf-versioning/13044/4 "2024-08-04T09:49:47Z")

</div>

+1 on this. Faced the same problem.

Release 1.23.2 [change](https://github.com/temporalio/sdk-java/compare/v1.23.1...v1.23.2) directly includes some protobuf files, leading to classpath conflicts

Here is a [related issue](https://github.com/temporalio/sdk-java/issues/2150) on github

---

<div class="post-metadata">

**Author:** ![Quinn\_Klassen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/quinn_klassen/32/3948_2.png) [@Quinn\_Klassen](https://community.temporal.io/u/Quinn_Klassen)\
**Post date:** [August 6, 2024, 8:48pm UTC](https://community.temporal.io/t/temporal-sdk-java-issue-with-protobuf-versioning/13044/5 "2024-08-06T20:48:35Z")

</div>

Yes this is because these google proto APIs were added to the main Temporal API

> **[api/google at master · temporalio/api](https://github.com/temporalio/api/tree/master/google)**
>
> Temporal gRPC API and proto files. Contribute to temporalio/api development by creating an account on GitHub.

Until these are removed the Java SDK will need to manually filter them out. That is tracked by this [issue](https://github.com/temporalio/sdk-java/issues/2150) and should be included in the next Java SDK release
