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.

Better detection of Spring Session store

See original GitHub issue

With the modules split in Spring Session 2, there is a high chance that the project’s classpath contains only one store implementation.

We should improve our auto-configuration structure to switch to that store in that case (and that case only) so that setting the property is not required.

There are two failures scenario to handle:

  • More than one implementation is available: report that the store-type parameter is not set and which implementations are current available
  • No implementation is available (that could happen for those migrating and having only spring-session-core on their classpath that used to contain the core implementations). Perhaps reusing the NoSuchBeanDefinition failure analyzer could be a good idea as it would tell why the stores were not configured. If Spring Session provides a way to discover the available implementations (as Spring Data does with spring.factories ) we could build a more dedicated error message.

/cc @rwinch @vpavic

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
snicollcommented, Sep 13, 2017

Failure analyzer for the first case

***************************
APPLICATION FAILED TO START
***************************

Description:

Multiple Spring Session store implementations are available on the classpath:
    - org.springframework.session.jdbc.JdbcOperationsSessionRepository
    - org.springframework.session.hazelcast.HazelcastSessionRepository


Action:

Consider any of the following:
    - Define the `spring.session.store-type` property to the store you want to use
    - Review your classpath and remove the unwanted store implementation(s)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Spring Session
Spring Session provides an API and implementations for managing a user's session information while also making it trivial to support clustered ...
Read more >
Guide to Spring Session | Java Development Journal
A guide to introducing Spring Session. Learn how to use this API in a project to decouples session management from server container.
Read more >
Spring Boot Session Management Example (2022)
As HTTP protocol is stateless, and to keep track of customer behavior, we need session management. Session Management is a web container framework...
Read more >
Storing Spring Sessions in Database using JDBC - SpringHow
When running multiple instances of the same application, sharing the session data can be a good idea. In this post we will take...
Read more >
Guide to Spring Session | Baeldung
Spring Session is a powerful tool for managing HTTP sessions. With our session storage simplified to a configuration class and a few Maven ......
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