Java sdk : org.ovirt.engine.sdk4.Error: No connection implementation found

Posted on

Hi,

I was trying to use java sdk version 4 and followed the guide from ovirt-engine/docs/manual/en_US/html/Java_SDK_Guide/index.html.

When I tried to run my java application, I got the below stacktrace:
Exception in thread "main" org.ovirt.engine.sdk4.Error: No connection implementation found
at org.ovirt.engine.sdk4.ConnectionBuilder.connection(ConnectionBuilder.java:77)
at com.test.Test.main(Test.java:20)
Caused by: java.lang.NoClassDefFoundError: org/apache/http/auth/AuthSchemeFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.ovirt.engine.sdk4.ConnectionBuilder.connection(ConnectionBuilder.java:74)
... 1 more
Caused by: java.lang.ClassNotFoundException: org.apache.http.auth.AuthSchemeFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 4 more

Where the Test.java at line 20 contains:

ConnectionBuilder myBuilder = ConnectionBuilder.connection()

            .url("https://[my-ip-for rhvm]/ovirt-engine/api")
            .user("admin@internal")
            .password("mypassword123")
            .trustStoreFile("/etc/pki/ovirt-engine/server.truststore")
            .trustStorePassword("myPassword123");

truststore is genearted using the steps mentioned in the Java_SDK guide.

Could you please help me to resolve this issue.
Not: I have installed the java sdk using , yum install java-ovirt-engine-sdk4

Thanks in advance.

Nani Babu Mutte's picture

Was this helpful?

We appreciate your feedback. Leave a comment if you would like to provide more detail.
It looks like we have some work to do. Leave a comment to let us know how we could improve.
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.