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

[Bug] protobuf-java should be an optional dependency for Pulsar Java client libraries #23469

Closed
lhotari opened this issue Oct 16, 2024 · 4 comments · Fixed by #23632
Closed
Assignees
Labels
triage/lhotari/important lhotari's triaging label for important issues or PRs

Comments

@lhotari
Copy link
Member

lhotari commented Oct 16, 2024

          > IMO, making protobuf-java optional is beyond the scope of this PR. It’s something worth discussing separately at a later stage.

It was always meant to be optional. It's already optional in the unshaded module. It was included as required dependency by mistake and this is why it's getting included in the shaded jar.

It don't think it's beyond the scope to fix the root cause of the issue.

Originally posted by @merlimat in #23468 (comment)

@Shawyeok
Copy link
Contributor

@lhotari
I'm working on this issue, please assign this to me.

@nodece
Copy link
Member

nodece commented Jan 7, 2025

@lhotari @Shawyeok Today, I'm testing the Pulsar 3.0.x, I notice this changes break my test:

java.lang.NoClassDefFoundError: com/google/protobuf/MapFieldReflectionAccessor
        at org.apache.pulsar.functions.utils.FunctionConfigUtils.convert(FunctionConfigUtils.java:102)
        at org.apache.pulsar.functions.utils.FunctionConfigUtils.convert(FunctionConfigUtils.java:89)
        at org.apache.pulsar.functions.utils.FunctionConfigUtils.convert(FunctionConfigUtils.java:77)

java.lang.NoClassDefFoundError: com/google/protobuf/MapFieldReflectionAccessor
        at org.apache.pulsar.functions.utils.SourceConfigUtils.convert(SourceConfigUtils.java:97)

Is this expected?

@Shawyeok
Copy link
Contributor

Shawyeok commented Jan 7, 2025

@lhotari @Shawyeok Today, I'm testing the Pulsar 3.0.x, I notice this changes break my test:

java.lang.NoClassDefFoundError: com/google/protobuf/MapFieldReflectionAccessor
        at org.apache.pulsar.functions.utils.FunctionConfigUtils.convert(FunctionConfigUtils.java:102)
        at org.apache.pulsar.functions.utils.FunctionConfigUtils.convert(FunctionConfigUtils.java:89)
        at org.apache.pulsar.functions.utils.FunctionConfigUtils.convert(FunctionConfigUtils.java:77)

java.lang.NoClassDefFoundError: com/google/protobuf/MapFieldReflectionAccessor
        at org.apache.pulsar.functions.utils.SourceConfigUtils.convert(SourceConfigUtils.java:97)

Is this expected?

@nodece
Does your classpath include the com.google.protobuf:protobuf-java JAR? If so, which version is it?

After #23632, users need to explicitly include the protobuf-java dependency.

@nodece
Copy link
Member

nodece commented Jan 7, 2025

@Shawyeok Thank you! These changes may affect some users.

Right now, The com.google.protobuf:protobuf-java dependency has been added to my project, and it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/lhotari/important lhotari's triaging label for important issues or PRs
Projects
None yet
3 participants