Adding Ondra ...
On Mon, Sep 10, 2018 at 9:53 AM, Joey Ma <majunjiev(a)gmail.com> wrote:
Hi all,
The patch to fix this has been committed via [1]. Basically the new code
forces the obtain method to be the one with no parameters specified. In
addition, if no obtain method found, do throw NoSuchMethodException error.
@Ondra, could you please help me to review it? Great thanks.
[1]:
https://gerrit.ovirt.org/#/c/94244/
On Mon, Sep 10, 2018 at 12:04 PM Joey Ma <majunjiev(a)gmail.com> wrote:
> Hi Patrick, Ondra,
>
> This issue could be reproduced in my local dev environment. After digging
> into the Java SDK, the issue probably is caused by getting the wrong method
> to invoke.
>
> Although the `DiskService.GetResponse` defined in API model has only a
> single @Out (getter) method `Disk disk()`, the Java SDK generator adds a
> additional setter method `void disk(Disk disk)` in
> `DiskService.GetResponse` class. The code here [1] use `getResponse.
> getClass().getDeclaredMethods()[0]` to fetch the method for getting the
> Disk, while it actually get the method `void disk(Disk disk)`, which
> obviously produces the `wrong number of arguments` error.
>
> This issue also affect fetching list of objects via `connection.link()`.
> I could get this fixed and commit a PR in gerrit soon.
>
> Please correct me if I'm wrong or missing anything. Thanks.
>
> [1]:
https://github.com/oVirt/ovirt-engine-sdk-java/blob/
> master/sdk/src/main/java/org/ovirt/engine/sdk4/internal/
> HttpConnection.java#L198
>
>
> On Fri, Sep 7, 2018 at 4:35 PM Geschwentner, Patrick <
> patrick.geschwentner(a)mindbreeze.com> wrote:
>
>> More details:
>> java.lang.IllegalArgumentException: wrong number of arguments
>> wrong number of arguments
>> org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException:
>> Type has not been loaded occurred while retrieving component type of array.
>>
>>
>> Patrick Geschwentner MSc, Customer Success Manager
>> patrick.geschwentner(a)mindbreeze.com
>>
>>
>> Handelsgericht Linz, FN 262155y
>> Mindbreeze Datenschutzerklärung
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Geschwentner, Patrick
>> Gesendet: Freitag, 7. September 2018 09:45
>> An: 'Ondra Machacek' <omachace(a)redhat.com>; devel(a)ovirt.org
>> Betreff: AW: [ovirt-devel] Error Java SDK Issue??
>>
>> Dear Mr. Machacek!
>> Here you are:
>> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
>> SLF4J: Defaulting to no-operation (NOP) logger implementation
>> SLF4J: See
http://www.slf4j.org/codes.html#StaticLoggerBinder for
>> further details.
>> Cloning .. (My custom log)
>> wrong number of arguments --- This is the error which occurs.
>> You need something more?
>> Best regards
>>
>>
>>
>> Patrick Geschwentner MSc, Customer Success Manager patrick.geschwentner@
>>
mindbreeze.com
>>
>> Mindbreeze GmbH | Honauerstraße 2 | 4020 Linz | Austria
>>
>>
>> Handelsgericht Linz, FN 262155y
>> Mindbreeze Datenschutzerklärung
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Ondra Machacek <omachace(a)redhat.com>
>> Gesendet: Freitag, 7. September 2018 09:29
>> An: Geschwentner, Patrick <patrick.geschwentner(a)mindbreeze.com>;
>> devel(a)ovirt.org
>> Betreff: Re: [ovirt-devel] Error Java SDK Issue??
>>
>> Can you please share Java SDK debug log?
>>
>> On 09/05/2018 04:44 PM, Geschwentner, Patrick wrote:
>> > Dear Ladies and Gentlemen!
>> > I am currently working with the java-sdk and I encountered a problem.
>> > If I would like to retrieve the disk details, I get the following
>> error:
>> > Disk currDisk =
>> > ovirtConnection.followLink(diskAttachment.disk());
>> >
>> > The Error is occurring in this line:
>> > [cid:image001.png@01D44537.AF127FD0]
>> > The getResponst looks quiet ok. (I inspected:
>> [cid:image002.png@01D44537.AF127FD0] and it looks ok).
>> >
>> >
>> > Error:
>> > wrong number of arguments
>> >
>> >
>> >
>> > The code is quiet similar to what you published on github (
>>
https://github.com/oVirt/ovirt-engine-sdk-java/blob/
>> master/sdk/src/test/java/org/ovirt/engine/sdk4/examples/ListVmDisks.java
>> ).
>> > Can you confirm the defect?
>> > Best regards
>> >
>> > Patrick
>> >
>> >
>> >
>> > _______________________________________________
>> > Devel mailing list -- devel(a)ovirt.org
>> > To unsubscribe send an email to devel-leave(a)ovirt.org Privacy
>> > Statement:
https://www.ovirt.org/site/privacy-policy/
>> > oVirt Code of Conduct:
>> >
https://www.ovirt.org/community/about/community-guidelines/
>> > List Archives:
>> >
https://lists.ovirt.org/archives/list/devel@ovirt.org/message/LRSERSM6
>> > 2LFEERD4AJ3FYFVNBHTF4E5J/
>> >
>> _______________________________________________
>> Devel mailing list -- devel(a)ovirt.org
>> To unsubscribe send an email to devel-leave(a)ovirt.org
>> Privacy Statement:
https://www.ovirt.org/site/privacy-policy/
>> oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-
>> guidelines/
>> List Archives:
https://lists.ovirt.org/archives/list/devel@ovirt.org/
>> message/ZQ2APEAOFHL4JSHQJZCBYK2R3QWMWG6V/
>>
>
_______________________________________________
Devel mailing list -- devel(a)ovirt.org
To unsubscribe send an email to devel-leave(a)ovirt.org
Privacy Statement:
https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-
guidelines/
List Archives:
https://lists.ovirt.org/archives/list/devel@ovirt.org/
message/XYG2MB3SZRW27PYZIBWHOKF4UAI52EMC/
--
Martin Perina
Associate Manager, Software Engineering
Red Hat Czech s.r.o.