Skip to content

Update Bucket4J to latest version #4488

@rcbandit111

Description

@rcbandit111

I have a gradle project with the following configuration:

plugins {
    id 'org.springframework.boot' version '3.5.0'
    id 'io.spring.dependency-management' version '1.1.7'
    id 'java'
}

ext {
    set('springCloudVersion', "2025.0.0")
}

implementation 'com.bucket4j:bucket4j_jdk17-core:8.15.0'
implementation 'com.bucket4j:bucket4j_jdk17-redis-common:8.15.0'
implementation 'com.bucket4j:bucket4j_jdk17-lettuce:8.15.0'
implementation 'org.springframework.cloud:spring-cloud-kubernetes-client-discovery'

During startup I get this error:

java.lang.NoSuchMethodError: 'void io.github.bucket4j.distributed.proxy.ClientSideConfig.<init>(io.github.bucket4j.distributed.versioning.Version, java.util.Optional, io.github.bucket4j.distributed.proxy.ExecutionStrategy, java.util.Optional, java.util.Optional, io.github.bucket4j.BucketListener, io.github.bucket4j.distributed.proxy.RecoveryStrategy)'
        at io.github.bucket4j.distributed.proxy.AbstractProxyManagerBuilder.getClientSideConfig(AbstractProxyManagerBuilder.java:236) ~[bucket4j_jdk17-core-8.15.0.jar!/:na]
        at io.github.bucket4j.redis.lettuce.cas.LettuceBasedProxyManager.<init>(LettuceBasedProxyManager.java:161) ~[bucket4j_jdk17-lettuce-8.15.0.jar!/:8.15.0]
        at io.github.bucket4j.redis.lettuce.Bucket4jLettuce$LettuceBasedProxyManagerBuilder.build(Bucket4jLettuce.java:152) ~[bucket4j_jdk17-lettuce-8.15.0.jar!/:8.15.0]
The called method's class, io.github.bucket4j.distributed.proxy.ClientSideConfig, is available from the following locations:

jar:nested:/gateway.jar/!BOOT-INF/lib/bucket4j-core-7.6.0.jar!/io/github/bucket4j/distributed/proxy/ClientSideConfig.class
jar:nested:/gateway.jar/!BOOT-INF/lib/bucket4j_jdk17-core-8.15.0.jar!/io/github/bucket4j/distributed/proxy/ClientSideConfig.class
After dependency lookup I see that there are 2 bucket4j version into my project:

Image

Can you update Bucket4J to the latest version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions