in use jedis connect redis And call publish Method to publish a message , There it is ArrayIndexOutOfBoundsException abnormal , What was used at that time was jedis2.1.0 edition , Look at the source code and find that it is write Method by increasing the count, Occurs when writing data to a cache byte array ArrayIndexOutOfBoundsException, And the anomaly is sporadic , Not necessarily , So the reason is not easy to trace .
I've seen it in other modules before jedis connect redis All kinds of problems appeared in , For example, there are the following exceptions :
org.jivesoftware.openfire.RedisConnection - Subscribing failed with exception:
redis.clients.jedis.exceptions.JedisConnectionException: Broken pipe         at
redis.clients.jedis.Connection.flush(         at
redis.clients.jedis.JedisPubSub.proceed(         at
redis.clients.jedis.Jedis.subscribe(         at
  at Caused by:
Broken pipe         at Method)
  at redis.clients.util.RedisOutputStream.flushBuffer(
at redis.clients.jedis.Connection.flush(         ... 4 more
Later, the solution was to replace it with a new version jedis Of jar package ——jedis2.5.1, What needs to be reminded is , This version uses commons-pool2 Yes commons-pool2-2.2.jar, need Java
6.0+. If it is used in the project at the same time commons
DBCP, Then you need to pay attention , If you use commons-dbcp-1.4, That still needs to be preserved commons-pool1.x(Java
6.0+), Otherwise, it is necessary to commons-dbcp Upgrade to 2.x edition , and commons-dbcp2-2.0.1 need Java 7.0+.
Process replacement jar, In release redis Some changes have also been made in connection , The connection and release will be retried several times .

©2019-2020 Toolsou All rights reserved,
QQ Login interface implementation code implementation mysql Addition, deletion, modification and query of database JAVA Experiment 4 set and functional programming experiment about String How to create objects VHDL——4 choose 1 Data selector C language ( Guess numbers games ) Blue Bridge Cup MCU advanced module --NE555 I don't memorize eight part essays , You go to the interview ? Hill sorting of sorting algorithm ——c++ realization python What does built-in function mean _python What are the built-in functions