Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@57d08368] was not registered for synchronization because synchronization is not active
JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@5666456f] will not be managed by Spring
==> Preparing: select * from admins where account=?
==> Parameters: admin1(String)
<== Columns: aid, account, controller, password, manage_users, manage_meetings, manage_events, manage_check_ins, publish_news, edit_home_page, manage_propositions, manage_public, propositions_dep_id, public_dep_id, status, is_super_admin, registration_time, update_time, logout_time
<== Row: 2, admin1, 管理员叶子, *****, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 已注销, 0, 2025-02-09 04:27:13, 2025-03-19 22:44:36, 2025-03-01 18:55:59
<== Total: 1
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@57d08368]
2025-04-09T09:29:53.088+08:00 ERROR 1771663 --- [nio-8090-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.data.redis.RedisSystemException: Error in execution] with root cause
io.lettuce.core.RedisReadOnlyException: READONLY You can't write against a read only replica.
at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:148) ~[lettuce-core-6.4.2.RELEASE.jar!/:6.4.2.RELEASE/f4dfb40]
at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:120) ~[lettuce-core-6.4.2.RELEASE.jar!/:6.4.2.RELEASE/f4dfb40]
at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:124) ~[lettuce-core-6.4.2.RELEASE.jar!/:6.4.2.RELEASE/f4dfb40]
at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:115) ~[lettuce-core-6.4.2.RELEASE.jar!/:6.4.2.RELEASE/f4dfb40]
at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:749) ~[lettuce-core-6.4.2.RELEASE.jar!/:6.4.2.RELEASE/f4dfb40]
at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:684) ~[lettuce-core-6.4.2.RELEASE.jar!/:6.4.2.RELEASE/f4dfb40]
at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:601) ~[lettuce-core-6.4.2.RELEASE.jar!/:6.4.2.RELEASE/f4dfb40]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.117.Final.jar!/:4.1.117.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.117.Final.jar!/:4.1.117.Final]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
**主要原因是:io.lettuce.core.RedisReadOnlyException: READONLY You can't write against a read only replica.**这主要是指Redis实例被配置为只读副本(read-only replica)模式,但是应用程序却尝试对其进行写操作。