I have a remote server running with oVirt 3.5
I'm using ovirt-engine-sdk-java-3.5.1.0-1.fc20.noarch.
there is code example:
my app:
=====================
package lab01;
import java.io.IOException;
import java.util.List;
import java.util.UUID;
import org.apache.http.client.ClientProtocolException;
import org.ovirt.engine.sdk.*;
import org.ovirt.engine.sdk.decorators.*;
import org.ovirt.engine.sdk.entities.*;
import org.ovirt.engine.sdk.exceptions.*;
public class Hello {
private static final String URL = "
https://10.64.0.204/api";
private static final String crt = "/home/david/Desktop/dev/server.truststore";
private static final String user = "admin@internal";
private static final String pass = "11111111";
public static void main(String[] args) throws ClientProtocolException, ServerException,
UnsecuredConnectionAttemptError, IOException {
Api api = new Api(URL, user, pass, crt);
}
}
======================
Description of problem:
While trying to start my app localy on my pc, I am getting an exception:
Exception in thread "main" java.lang.IllegalArgumentException: Port is invalid
at org.apache.http.util.Args.check(Args.java:36)
at org.apache.http.conn.scheme.Scheme.<init>(Scheme.java:92)
at org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.createSchemeRegistry(ConnectionsPoolBuilder.java:358)
at org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.createPoolingClientConnectionManager(ConnectionsPoolBuilder.java:289)
at org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.createDefaultHttpClient(ConnectionsPoolBuilder.java:261)
at org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.build(ConnectionsPoolBuilder.java:413)
at org.ovirt.engine.sdk.Api.<init>(Api.java:131)
at lab01.Hello.main(Hello.java:24)
But I can connect to the server in https using curl or webrowser.