java.lang.IllegalAccessError: class io.milvus.grpc.DescribeCollectionResponse tried to access method 'com.google.protobuf.LazyStringArrayList com.google.protobuf.LazyStringArrayList.emptyList()' (io.milvus.grpc.DescribeCollectionResponse and com.google.protobuf.LazyStringArrayList are in unnamed module of loader 'app')
以上为报错信息。报错原因是mysql和milvus同时用了Google的protobuf的依赖,两者版本不同导致同时引入两个不同版本的依赖,JVM不知道用哪个。
解决方法:
一般来说版本直接差异不大,所以直接把mysql的这个依赖排除了
<!--mysql--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <exclusions> <exclusion> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> </exclusion> </exclusions> </dependency>