小编Tec*_*eek的帖子

Elastic 中的访问控制 - 缺少 REST 请求的身份验证凭据

我正在使用 Elastic 7.9.2 版本并希望使用安全性。所以我跑了:

bin/elasticsearch-certutil cert -out config/elastic-certificates.p12 -pass ""
Run Code Online (Sandbox Code Playgroud)

然后添加

xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p1
Run Code Online (Sandbox Code Playgroud)

config/elasticsearch.yaml

现在当我运行 ES 时

 bin/elasticsearch
Run Code Online (Sandbox Code Playgroud)

出现以下错误:

"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials
 for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-
8\""}}],"type":"security_exception","reason":"missing authentication credentials for REST 
request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-
8\""}},"status":401}root@ip-localhost:/var/log/elasticsearch
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮忙吗!

elasticsearch kibana amazon-elastic-beanstalk elastic-stack elasticsearch-x-pack

15
推荐指数
2
解决办法
5万
查看次数

无法解析类型 org.powermock.api.support.membermodification.MemberModifier。它是从所需的 .class 文件间接引用的

我的类路径中有以下罐子

  1. powermock-module-junit4-2.0.7.jar
  2. powermock-api-mockito2-2.0.7.jar
  3. powermock-api-support-1.4.9.jar
  4. 模拟核心-2.8.9.jar
  5. junit-4.10.jar

我导入了以下课程。

import static org.junit.Assert.assertEquals;
import static org.powermock.api.mockito.PowerMockito.doReturn;
import static org.powermock.api.mockito.PowerMockito.spy;
import static org.powermock.api.mockito.PowerMockito.verifyPrivate;
import static org.powermock.api.mockito.PowerMockito.when;
import static org.powermock.api.mockito.PowerMockito.mock;
import org.powermock.modules.junit4.PowerMockRunner;
Run Code Online (Sandbox Code Playgroud)

然后我在执行测试类时收到以下错误

The type org.powermock.api.support.membermodification.MemberModifier cannot be resolved. It is indirectly referenced from required .class files
Run Code Online (Sandbox Code Playgroud)

PS:我没有使用像Spring Boot这样的任何框架请帮忙!

java junit junit4 mockito powermockito

5
推荐指数
1
解决办法
3963
查看次数