IAE during dynamic proxy instantiation

Description

The following splat is encountered in downstream integration:

Caused by: java.lang.IllegalArgumentException: com.google.common.util.concurrent.ListenableFuture referenced from a method is not visible from class loader: org.eclipse.osgi.internal.loader.EquinoxClassLoader @612086b4 at java.lang.reflect.Proxy$ProxyBuilder.ensureVisible(Proxy.java:884) ~[?:?] at java.lang.reflect.Proxy$ProxyBuilder.validateProxyInterfaces(Proxy.java:732) ~[?:?] at java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:648) ~[?:?] at java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:656) ~[?:?] at java.lang.reflect.Proxy.lambda$getProxyConstructor$0(Proxy.java:429) ~[?:?] at jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329) ~[?:?] at jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205) ~[?:?] at java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:427) ~[?:?] at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037) ~[?:?] at org.opendaylight.mdsal.binding.dom.adapter.RpcAdapter.<init>(RpcAdapter.java:49) ~[?:?] at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMRpcServiceAdapter.loadAdapter(BindingDOMRpcServiceAdapter.java:43) ~[?:?] at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMRpcServiceAdapter.loadAdapter(BindingDOMRpcServiceAdapter.java:24) ~[?:?] at org.opendaylight.mdsal.binding.dom.adapter.AbstractBindingLoadingAdapter$1.load(AbstractBindingLoadingAdapter.java:21) ~[?:?] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3576) ~[?:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2318) ~[?:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2191) ~[?:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2081) ~[?:?] at com.google.common.cache.LocalCache.get(LocalCache.java:4019) ~[?:?] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4042) ~[?:?] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5024) ~[?:?] at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5031) ~[?:?] at org.opendaylight.mdsal.binding.dom.adapter.AbstractBindingLoadingAdapter.getAdapter(AbstractBindingLoadingAdapter.java:30) ~[?:?] at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMRpcServiceAdapter.getRpc(BindingDOMRpcServiceAdapter.java:35) ~[?:?] at org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiRpcService.getRpc(OSGiRpcService.java:36) ~[?:?] at org.opendaylight.controller.sample.kitchen.impl.KitchenServiceImpl.<init>(KitchenServiceImpl.java:69) ~[?:?] ... 45 more

The problem here is that our elimination of yang.binding.RpcService-generated classes done in MDSAL-772, generated binding bundles no longer directly import ListenableFuture's package.

Environment

None

Activity

Show:

Robert Varga January 18, 2024 at 5:57 PM

backported version does not need to touch RPC generation because the ListenableFuture is pulled in by the FooService class.

Robert Varga January 17, 2024 at 5:08 PM

This affects actions as well – and that case affects earlier versions as well. The problem is that if a module defines only actions, earlier releases will not generate the blanket RpcService specialization – and hence the generated code's bundle will not contain imports either.

The real solution is https://lf-opendaylight.atlassian.net/browse/MDSAL-774#icft=MDSAL-774, but that runs into lifecycle issues (i.e. we need to revoke the generated proxy if the BindingRuntimeContext changes, which brings about dragons).

As a stopgap let's just generate @Override methods, which will bring ListenableFuture back into view and fix this problem.

Done

Details

Assignee

Reporter

Labels

Priority

Created January 17, 2024 at 4:34 PM
Updated January 19, 2024 at 1:53 PM
Resolved January 19, 2024 at 1:53 PM