[ovirt-users] Ovirt Java SDK
Juan Hernández
jhernand at redhat.com
Fri Dec 23 15:54:03 UTC 2016
Looks like what you are trying to do is build the SDK yourself. That
should work, and we will try to fix any issue you find.
But I guess that what you want is to use it, not build it. The SDK is
distributed via Maven Central, already built. I am attaching an example
complete Maven project. Import that project into Eclipse (or any other
IDE that supports importing Maven projects), and then you can start
playing with it.
You can also modify manually the connection parameters in the
"Main.java" file, and then run it from the command line:
mvn exec:java
The Main.java class is just an example, and you have a collection of
similar examples here:
https://github.com/oVirt/ovirt-engine-sdk-java/tree/master/sdk/src/test/java/org/ovirt/engine/sdk4/examples
The Javadoc for the SDK is also available, here:
http://www.javadoc.io/doc/org.ovirt.engine.api/sdk/4.0.3
Let us know if you have issues.
On 12/22/2016 12:33 PM, TranceWorldLogic . wrote:
> Hi,
>
> I am getting below error logs
> ---------------
> [INFO] ERROR org.ovirt.api.metamodel.tool.Main - Error while executing
> the "run" method of tool class "org.ovirt.sdk.java.Tool".
> [INFO] java.lang.reflect.InvocationTargetException
> [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [INFO] at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> [INFO] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> [INFO] at java.lang.reflect.Method.invoke(Method.java:498)
> [INFO] at org.ovirt.api.metamodel.tool.Main.main(Main.java:74)
> [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [INFO] at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> [INFO] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> [INFO] at java.lang.reflect.Method.invoke(Method.java:498)
> [INFO] at
> org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
> [INFO] at java.lang.Thread.run(Thread.java:745)
> [INFO] Caused by: java.lang.NoSuchMethodError:
> org.apache.commons.cli.Option.builder()Lorg/apache/commons/cli/Option$Builder;
> [INFO] at org.ovirt.sdk.java.Tool.run(Tool.java:71)
> [INFO] at
> org.ovirt.sdk.java.Tool$Proxy$_$$_WeldClientProxy.run(Unknown Source)
> [INFO] ... 11 more
> [INFO] Weld SE container STATIC_INSTANCE shut down by shutdown hook
> -------------------------
>
> Please let me know what is wrong I did.
>
> Thanks,
> ~Rohit
>
> On Thu, Dec 22, 2016 at 3:56 PM, Roy Golan <rgolan at redhat.com
> <mailto:rgolan at redhat.com>> wrote:
>
>
>
> On 22 December 2016 at 11:21, TranceWorldLogic .
> <tranceworldlogic at gmail.com <mailto:tranceworldlogic at gmail.com>> wrote:
>
> Hi,
>
> I want to try Java SDK to see its usability.
>
> Can someone help me how to checkout code and compile Java SDK ?
> or Install Java SDK ?
>
> I am using Eclipse-Java for IDE.
>
>
>
> Start with the readme
> https://github.com/oVirt/ovirt-engine-sdk-java/tree/master/sdk
> <https://github.com/oVirt/ovirt-engine-sdk-java/tree/master/sdk>
> and check out the examples
> https://github.com/oVirt/ovirt-engine-sdk-java/tree/master/sdk/src/test/java/org/ovirt/engine/sdk4/examples
> <https://github.com/oVirt/ovirt-engine-sdk-java/tree/master/sdk/src/test/java/org/ovirt/engine/sdk4/examples>
>
>
> Thanks,
> ~Rohit
>
> _______________________________________________
> Users mailing list
> Users at ovirt.org <mailto:Users at ovirt.org>
> http://lists.ovirt.org/mailman/listinfo/users
> <http://lists.ovirt.org/mailman/listinfo/users>
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sdktest.zip
Type: application/zip
Size: 2928 bytes
Desc: not available
URL: <http://lists.ovirt.org/pipermail/users/attachments/20161223/6a723ea3/attachment-0001.zip>
More information about the Users
mailing list