gpt4 book ai didi

java - OpenStack 连接时抛出 NullPointerException

转载 作者:行者123 更新时间:2023-12-01 12:30:44 24 4
gpt4 key购买 nike

我正在尝试连接OpenStack在创建租户之前。它从“openstack-client-3.2.1.jar”中的 OpenStackClient.request() 给出了 NullPointerException

代码和堆栈跟踪的开头如下:

UsernamePassword usernamePassword = new UsernamePassword(userA,passA)
com.woorea.openstack.keystone.model.Access access =
keystone
.tokens()
.authenticate(usernamePassword)
.execute();

堆栈跟踪是:

 [java] java.lang.NullPointerException
[java] at com.woorea.openstack.base.client.OpenStackClient.request(OpenStackClient.java:51)
[java] at com.woorea.openstack.base.client.OpenStackClient.execute(OpenStackClient.java:66)
[java] at com.woorea.openstack.base.client.OpenStackRequest.execute(OpenStackRequest.java:98)
[java] at vep.openstack.OpenStackConnector.addUser(OpenStackConnector.java:624)

最佳答案

需要添加下面列出的三个库(即 openstack-client-connectors)之一:

Jersey 连接器

jersey2-连接器

resteasy 连接器

关于java - OpenStack 连接时抛出 NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25937637/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com