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] use dependency pulsar-client 3.3.1 will occured error AbstractMethodError #23203

Closed
3 tasks done
LynnHung1206 opened this issue Aug 20, 2024 · 4 comments
Closed
3 tasks done
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@LynnHung1206
Copy link

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

MacOS/Java21/Pulsar-client 3.3.1

Minimal reproduce step

add dependency in the pom.xml

<dependency>
            <groupId>org.apache.pulsar</groupId>
            <artifactId>pulsar-client</artifactId>
            <version>3.3.1</version>
        </dependency>

and run application
wait for maybe 10 minutes will get an error

java.lang.AbstractMethodError: Receiver class org.apache.pulsar.client.impl.PulsarClientImpl does not define or inherit an implementation of the resolved method 'abstract java.util.concurrent.CompletableFuture getPartitionsForTopic(java.lang.String)' of interface org.apache.pulsar.client.api.PulsarClient.
	at org.apache.pulsar.client.impl.MultiTopicsConsumerImpl.subscribeIncreasedTopicPartitions(MultiTopicsConsumerImpl.java:1368) ~[pulsar-client-3.3.1.jar:3.3.1]
	at org.apache.pulsar.client.impl.MultiTopicsConsumerImpl.access$200(MultiTopicsConsumerImpl.java:82) ~[pulsar-client-3.3.1.jar:3.3.1]
	at org.apache.pulsar.client.impl.MultiTopicsConsumerImpl$TopicsPartitionChangedListener.lambda$onTopicsExtended$0(MultiTopicsConsumerImpl.java:1351) ~[pulsar-client-3.3.1.jar:3.3.1]
	at java.base/java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4709) ~[na:na]
	at org.apache.pulsar.client.impl.MultiTopicsConsumerImpl$TopicsPartitionChangedListener.onTopicsExtended(MultiTopicsConsumerImpl.java:1351) ~[pulsar-client-3.3.1.jar:3.3.1]

What did you expect to see?

no error

What did you see instead?

java.lang.AbstractMethodError: Receiver class org.apache.pulsar.client.impl.PulsarClientImpl does not define or inherit an implementation of the resolved method 'abstract java.util.concurrent.CompletableFuture getPartitionsForTopic(java.lang.String)' of interface org.apache.pulsar.client.api.PulsarClient.
	at org.apache.pulsar.client.impl.MultiTopicsConsumerImpl.subscribeIncreasedTopicPartitions(MultiTopicsConsumerImpl.java:1368) ~[pulsar-client-3.3.1.jar:3.3.1]
	at org.apache.pulsar.client.impl.MultiTopicsConsumerImpl.access$200(MultiTopicsConsumerImpl.java:82) ~[pulsar-client-3.3.1.jar:3.3.1]
	at org.apache.pulsar.client.impl.MultiTopicsConsumerImpl$TopicsPartitionChangedListener.lambda$onTopicsExtended$0(MultiTopicsConsumerImpl.java:1351) ~[pulsar-client-3.3.1.jar:3.3.1]
	at java.base/java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4709) ~[na:na]
	at org.apache.pulsar.client.impl.MultiTopicsConsumerImpl$TopicsPartitionChangedListener.onTopicsExtended(MultiTopicsConsumerImpl.java:1351) ~[pulsar-client-3.3.1.jar:3.3.1]

Anything else?

"The error occurred in the method getPartitionsForTopic in PulsarClientImpl. It expects a String, but the method is defined as:

public CompletableFuture<List<String>> getPartitionsForTopic(String topic, boolean metadataAutoCreationEnabled) {
//...
}

"

When I use version 3.2.2 everything is alright.

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@LynnHung1206 LynnHung1206 added the type/bug The PR fixed a bug or issue reported a bug label Aug 20, 2024
@lhotari
Copy link
Member

lhotari commented Aug 20, 2024

Just wondering if there's a chance that there are multiple Pulsar client versions in the classpath?
@LynnHung1206 do you have a chance to add pulsar-bom to dependencyManagement as instructed in https://pulsar.apache.org/docs/3.3.x/client-libraries-java-setup/#pulsar-bom ?

@lhotari
Copy link
Member

lhotari commented Aug 21, 2024

@LynnHung1206 Please provide feedback whether the problem was resolved and how it was resolved. Thanks!

@LynnHung1206
Copy link
Author

ok! I try to add the dependency pulsar-bom and it works!
thanks!

@lhotari
Copy link
Member

lhotari commented Aug 21, 2024

ok! I try to add the dependency pulsar-bom and it works!
thanks!

@LynnHung1206 Great! Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

2 participants