joynr icon indicating copy to clipboard operation
joynr copied to clipboard

Misleading exception message "No @JoynrVersion found on interface" while proxy creation

Open svettwer opened this issue 6 years ago • 0 comments

Hi all,

as I was creating some integration tests for a joynr application, I came over the following scenario with Joynr Version 1.2.0.

I created a backend proxy like:

this.backendProxy = runtime.getProxyBuilder(
           "my.domain", 
           MyServiceBackendSync.class)
       .build();

and received the exception No @JoynrVersion found on interface [...]

I found out that I just used the backend sync class instead of the backend proxy class. So as I exchanged MyServiceBackendSync.class with MyServiceBackendProxy.class everything was fine.

Nevertheless, to realize that, it took me some time. Therefore I would like to suggest, that the ProxyBuilderDefaultImpl checks whether the given interface class is really a proxy specification before running into the exception thrown from the VersionUtil. From my perspective, I cannot suggest a solution because the BackendProxy classes seem to have no common interface which one could check.

As this is suggestion is more about convenience, it might won't be on your prio list for a long time but maybe sometimes in the future. =)

EDIT: To be honest, the exception is not misleading at all, as there is really no @JoynrVersion on the interface. But maybe a message like "ProxyBuilderException: The given interface class does not define a Proxy." would improve the debugging.

BR, Sven

svettwer avatar Aug 27 '19 15:08 svettwer