当我调用相应的方法时,我看到以下错误:
Exception in thread "main" java.lang.NoSuchMethodError: com/google/common/collect/Sets.newIdentityHashSet()Ljava/util/Set;
这是我的代码:
Client client = ClientBuilder.newClient();
WebTarget sendWT = client.target(blueMailUrl);
url.openConnection();
Invocation.Builder builder = ((WebTarget) sendWT)
.request(MediaType.APPLICATION_JSON)
.header("Authorization","Basic " + DatatypeConverter.printBase64Binary((byte[]) (blueMailUserid + ":" + blueMailPassword)
.getBytes("UTF-8")));
答案 0 :(得分:0)
java.lang.NoSuchMethodError
发生在编译期间有方法(实际上是类)可用且在运行时缺少该方法时。
确保在运行时将项目的所有依赖项添加到类路径中
对于您而言,请检查classpath中是否有google-collections jar文件