lettuce-core: Could not initialize JfrConnectionCreatedEvent

Bug Report

Current Behavior

Since the latest Spring 2.5.0 Update we observe a Lettuce/Redis Error on every single Request, which basically breaks our App. It is in the Stacktrace below.

We use the default Property based Autoconfiguration. Spring 2.4.5 worked perfectly fine. Has something changed that i am not aware of?

Stack trace
Unhandled Exception in Controller, returning: HTTP 500 INTERNAL_SERVER_ERROR
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class io.lettuce.core.event.connection.JfrConnectionCreatedEvent

Expected behavior/code

It should work fine like it did with Spring 2.4.5.

Environment

  • spring-boot-starter-data-redis: 2.5.0

Any help/hint is greatly appreciated

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (8 by maintainers)

Commits related to this issue

Most upvoted comments

For visibility, adding --add-reads=jdk.jfr=ALL-UNNAMED to your JVM args will resolve the issue. TBD if this is something that needs to be permanent or addressed in future agent release.

We took help from app dymanics team, they have made some changes in the agent configuration which resolved the issue

The property is a system property. Spring Boot’s application properties are not system properties. If you do not have access to system properties I suggest setting the system property in your main method before invoking SpringApplication.run(…).