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

BeanCreationException error after upgrading to version 8.x #35

Closed
rafa-acioly opened this issue Jun 7, 2023 · 7 comments
Closed

BeanCreationException error after upgrading to version 8.x #35

rafa-acioly opened this issue Jun 7, 2023 · 7 comments
Assignees
Labels
bug Something isn't working stale

Comments

@rafa-acioly
Copy link

Describe the bug

After upgrading java from version 16 to 17 and upgrading the config-cat lib from vesion 6.x to 8.x, the Bean creation on spring started to fail with the exception BeanCreationException

To reproduce

Upgrade java vertion to 17 and config-cat to 8.x

<dependency>
      <groupId>com.configcat</groupId>
      <artifactId>configcat-java-client</artifactId>
      <version>[8.0.0,)</version>
    </dependency>

Change the bean creation from:

@Bean
    ConfigCatClient configCatClient() {
        return ConfigCatClient
            .newBuilder()
            .mode(PollingModes.autoPoll(60))
            .logLevel(LogLevel.WARNING)
            .build(this.settings.sdkKey)
    }

To:

import com.configcat.*;

@Bean
    ConfigCatClient configCatClient() {
        return ConfigCatClient.get(this.settings.sdkKey, options -> {
          options.pollingMode(PollingModes.autoPoll());
          options.logLevel(LogLevel.WARNING);
        })
    }

The error:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configCatClient' defined in class path resource [br/com/blz/myrepo/config/ConfigCat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.configcat.ConfigCatClient]: Factory method 'configCatClient' threw exception; nested exception is java.lang.reflect.GenericSignatureFormatError: Signature Parse error: expected a class type
@rafa-acioly rafa-acioly added the bug Something isn't working label Jun 7, 2023
@novalisdenahi novalisdenahi self-assigned this Jun 7, 2023
@novalisdenahi
Copy link
Contributor

Hi, @rafa-acioly!
Thank you for the issue! I will check on the problem and let you know if we fixed the problem.

@rafa-acioly
Copy link
Author

@novalisdenahi Is there a temporary solution to this? Maybe another version?

@novalisdenahi
Copy link
Contributor

@rafa-acioly Can you provide me with a little bit more info? I tried to reproduce the error, but I couldn't do it.
Worked with Maven and Gradle as well. Different java versions, and I tried other versions of org.springframework.boot plugin as well (maven/gradle both worked well).

Can you try with the fix 8.1.0 configcat-java-client version?
Also, can you provide me with the exact java and spring version?

Thanks in advance!

@rafa-acioly
Copy link
Author

@novalisdenahi I found the error cause, for some reason the newrelic library was having problem with completabe future and was messing up everything.

@novalisdenahi
Copy link
Contributor

@rafa-acioly Did you manage to solve the problem? Let us know if everything works fine so we can close the issue.
Otherwise, please provide us with more info regarding the cause of the problem.

Thanks in advance!

@github-actions
Copy link

This issue is marked stale because it has no activity in the last 3 weeks. The issue will be closed in one week. Please remove the stale flag to keep it open.

@github-actions github-actions bot added the stale label Jul 11, 2023
@github-actions
Copy link

This issue was closed due to no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants