How to solve the error when springboot configures redis project startup
Error when configuring the redis project in springboot
When I first started learning redis, I followed the online tutorials to integrate redis and jedis into spring boot. After the integration was completed, the startup project always failed
The following error always pops up
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.repository.config.RepositoryConfigurationSource
******************************
APPLICATION FAILED TO START
*** ************************
Description:
An attempt was made to call the method org.springframework. data.repository.config.RepositoryConfigurationSource.getAttribute(Ljava/lang/String;)Ljava/lang/String; but it does not exist. Its class, org.springframework.data.repository.config.RepositoryConfigurationSource, is available from the following locations :
jar:file:/D:/m2/repository/org/springframework/data/spring-data-commons/2.0.10.RELEASE/spring-data-commons-2.0.10.RELEASE.jar !/org/springframework/data/repository/config/RepositoryConfigurationSource.class
It was loaded from the following location:
file:/D:/m2/repository/org/springframework/data /spring-data-commons/2.0.10.RELEASE/spring-data-commons-2.0.10.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.repository.config.RepositoryConfigurationSource
2018-11-22 13:03:51.398 INFO 2196 --- [main] ConfigServletWebServerApplicationContext: Closing org.springframework.boot. web.servlet.context.AnnotationConfigServletWebServerApplicationContext@1a451d4d: startup date [Thu Nov 22 13:03:50 CST 2018]; root of context hierarchy
Process finished with exit code 1
Then I searched online for a long time, but there was no solution to this error. I accidentally saw a blog. It also had a type error when starting the project, and it was also a jar package conflict. Then the blogger changed redis and jedis The version number solved the problem. I also changed the version number to the same as that of the blogger, but the same error still occurred after startup.
Later I thought if I remove all the version numbers and let "spring-boot-starter-parent" automatically provide us with the corresponding version of the jar package, this way I can avoid the possibility of having to specify the version number myself. Some unexpected conflicts. So when I removed the version numbers of redis and jedis, the project started successfully
What a strange error..
Solution to springboot project Redis reports an error during startup
The problem of ERR Client sent AUTH, but no password is set
First look at the part of my springboot configuration redis as shown below:
Obviously the startup password of redis configured above is 123456,
The local redis version is 3.0.1. The requirepass content in the redis.windows.conf file has also changed the password to 123456. Let’s talk about it here. , when removing the # sign in front of requirepass, be sure to note that there is still a space to remove, otherwise an error will be reported:
Invalid argument during startup: unknown conf file parameter : requirepass
At this time, it means that the redis password is consistent with springboot. The next step is to start redis and then springboot.
The method to start Redis is to enter its installation directory, run redis-server.exe, and then start according to the normal process. However, once springboot is started, an error will occur when accessing redis, as shown in the following figure:
At first I thought it was the 2.9.0 redis introduced in my Pom.xml file The version is incompatible due to dependencies. I have been looking for the installation package of Redis 2.9.0 but it is not available online. Half a day wasted.
I later discovered that this error was telling me that I had not set a password. The reason is the wrong method at startup.
Please remember to start local redis. If you set a password, remember to bring the configuration file. The complete startup command is:
redis-server.exe redis.windows.conf
The above is the detailed content of How to solve the error when springboot configures redis project startup. For more information, please follow other related articles on the PHP Chinese website!

Compared with other databases, Redis has the following unique advantages: 1) extremely fast speed, and read and write operations are usually at the microsecond level; 2) supports rich data structures and operations; 3) flexible usage scenarios such as caches, counters and publish subscriptions. When choosing Redis or other databases, it depends on the specific needs and scenarios. Redis performs well in high-performance and low-latency applications.

Redis plays a key role in data storage and management, and has become the core of modern applications through its multiple data structures and persistence mechanisms. 1) Redis supports data structures such as strings, lists, collections, ordered collections and hash tables, and is suitable for cache and complex business logic. 2) Through two persistence methods, RDB and AOF, Redis ensures reliable storage and rapid recovery of data.

Redis is a NoSQL database suitable for efficient storage and access of large-scale data. 1.Redis is an open source memory data structure storage system that supports multiple data structures. 2. It provides extremely fast read and write speeds, suitable for caching, session management, etc. 3.Redis supports persistence and ensures data security through RDB and AOF. 4. Usage examples include basic key-value pair operations and advanced collection deduplication functions. 5. Common errors include connection problems, data type mismatch and memory overflow, so you need to pay attention to debugging. 6. Performance optimization suggestions include selecting the appropriate data structure and setting up memory elimination strategies.

The applications of Redis in the real world include: 1. As a cache system, accelerate database query, 2. To store the session data of web applications, 3. To implement real-time rankings, 4. To simplify message delivery as a message queue. Redis's versatility and high performance make it shine in these scenarios.

Redis stands out because of its high speed, versatility and rich data structure. 1) Redis supports data structures such as strings, lists, collections, hashs and ordered collections. 2) It stores data through memory and supports RDB and AOF persistence. 3) Starting from Redis 6.0, multi-threaded I/O operations have been introduced, which has improved performance in high concurrency scenarios.

RedisisclassifiedasaNoSQLdatabasebecauseitusesakey-valuedatamodelinsteadofthetraditionalrelationaldatabasemodel.Itoffersspeedandflexibility,makingitidealforreal-timeapplicationsandcaching,butitmaynotbesuitableforscenariosrequiringstrictdataintegrityo

Redis improves application performance and scalability by caching data, implementing distributed locking and data persistence. 1) Cache data: Use Redis to cache frequently accessed data to improve data access speed. 2) Distributed lock: Use Redis to implement distributed locks to ensure the security of operation in a distributed environment. 3) Data persistence: Ensure data security through RDB and AOF mechanisms to prevent data loss.

Redis's data model and structure include five main types: 1. String: used to store text or binary data, and supports atomic operations. 2. List: Ordered elements collection, suitable for queues and stacks. 3. Set: Unordered unique elements set, supporting set operation. 4. Ordered Set (SortedSet): A unique set of elements with scores, suitable for rankings. 5. Hash table (Hash): a collection of key-value pairs, suitable for storing objects.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

Atom editor mac version download
The most popular open source editor

SublimeText3 English version
Recommended: Win version, supports code prompts!