Complete error reporting information:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: redis.clients.jedis.JedisPoolConfig.setMinEvictableIdleTime(Ljava/time/Duration;)V] with root cause java.lang.NoSuchMethodError: redis.clients.jedis.JedisPoolConfig.setMinEvictableIdleTime(Ljava/time/Duration;)V
Reason 1:
Other components in Maven depend on the old version of jedis and need to be excluded
Solution to cause 1:
In <dependency></dependency> Add and exclude the dependency of old jedis
<exclusions> <exclusion> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </exclusion> </exclusions>
Reload Maven’s dependent components and run them again.
Reason 2:
Jedispoolconfig and jedissentinelpool use Apache Commons-pool2 package for Commons
Although no error will be reported when compiling the code, the runtime will prompt that the package cannot be found. (suspected to be the reason for using reflection)
Solution to cause 2:
In POM XML <dependencies></dependencies> Add the following configuration to the:
<dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> <version>2.11.1</version> </dependency>
Reload Maven’s dependent components and run them again.
Similar Posts:
- SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path
- [Solved] An attempt was made to call a method that does not exist. The attempt was made from the following location:
- Factory method ‘eurekaClient’ threw exception; nested exception is java.lang.RuntimeException: Failed to initialize DiscoveryClient!
- [Solved] java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUni
- [Solved] Jsonobject has no from object, idea has no Maven dependency, jsonobject Maven dependency package
- [Solved] Jedis:Exception in thread “main” java.lang.VerifyError: Bad type on operand stack
- ERROR in ch.qos.logback.core.joran.spi.Interpreter@73:41 – no applicable action for [AppenderRef], current ElementPath is [[Configuration][Loggers][Root][AppenderRef]]
- How to Solve Jedis Error: java.lang.ClassCastException: java.lang.Long cannot be cast to [B
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory
- [Solved] Springboot Use Redis Error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘redisTemplate’ defined in class path resource