异常描述如下
Caused by: java.lang.IllegalAccessError: tried to access method com.test.framework.replica.TopicUtil.get(Lcom/test/tool/AvailableZone;)Lcom/test/framework/replica/ReplicaTopicUtil$MostMatchIdc; from class com.test.framework.jedis.replica.JedisReplicaTopicUtil
at com.test.framework.jedis.replica.JedisReplicaTopicUtil.getReplicaTopicByAz(JedisReplicaTopicUtil.java:22) ~[test-framework-redis-1.0.437.jar:1.0.437]
at com.test.framework.jedis.JedisClusterByZooKeeper.(JedisClusterByZooKeeper.java:80) ~[test-framework-redis-1.0.437.jar:1.0.437]
IllegalAccessError的说明
首先看一下异常IllegalAccessError。JavaDoc的意思是说在运行时尝试访问或者修改一个字段、或者访问不了某个方法(例如方法的访问权限是包级别,但是在这个包的外面访问的该方法,例如项目的依赖发生变化的时候)。
public class IllegalAccessError
extends IncompatibleClassChangeError
Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to.
Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.
解决方法
根据异常栈,看到底是哪里抛出了这个异常,去相应的类和方法看一下,确认是不是真的没有访问权限。