question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not initialize JfrConnectionCreatedEvent

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:24 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
brettalcoxcommented, Mar 17, 2022

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.

2reactions
mp911decommented, Jun 24, 2021

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(…).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting exception NoClassDefFoundError when connecting to ...
I'm new to java. Trying to connect to Redis with Lettuce. Environment: openjdk - 15.0.1, Lettuce-core-6.0.1.
Read more >
LettuceConnectionFactory (Spring Data Redis 3.0.0 API)
Indicates shared connections should be eagerly initialized. String. getHostName(). Returns the current host. io.lettuce.core.AbstractRedisClient.
Read more >
lettuce-io/lettuce-core 6.1.3.RELEASE on GitHub
Introduce API to allow for extending RedisClusterClient and its connections #1754; Could not initialize JfrConnectionCreatedEvent #1767 ...
Read more >
Could not initialize JfrConnectionCreatedEvent - Codesti
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.
Read more >
Lettuce Reference Guide
methods are now blocking to await pool initialization. ... However, there are some cases you should not share a connection among threads to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found