VMware Cloud Community
mbhajare
Contributor
Contributor

vcdclient is not able to login using Java SDK

Hi,

We've written sample vcdClient.java and we are using vcloud-java-sdk-5.5.0.jar file to access vcloud director setup.

Using below mentioned code, we are able to create instance of vcloudClient:

VcloudClient vcloudClient = new VcloudClient(vcdUrl, Version.V5_5);

However, when we try to login using below code:

vcloudClient.login(userName, password);

We are not able to login to vCloud Director and we are getting below exception:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1

    at java.lang.String.substring(Unknown Source)

    at com.vmware.vcloud.sdk.VcloudClient.login(VcloudClient.java:316)

    at com.netmagic.vmware.vcd.Vcd.getVcdClient(Vcd.java:142)

    at com.netmagic.vmware.vcd.Vcd.main(Vcd.java:51)

We tried to login to vCloud director setup using fully qualified path as well as using IP address.

Still for both the things we are getting the same above error.

Jars which we have included in our project are:

amqp-client-2.8.6.jar

commons-codec-1.6.jar

commons-logging-1.1.1.jar

httpclient-4.2.jar

httpcore-4.2.jar

rest-api-schemas-5.5.0.jar &

vcloud-java-sdk-5.5.0.jar

We are using Java 1.6 and we are not using SSL certificate to connect to vcloud director setup as of now.

0 Kudos
0 Replies