I have an interface as Iface that has two methods written in java. That interface is an inner interface of Zzz class. I have written the invocation handler in scala. Then I tried to create a new proxy instance in scala like below.
val handler = new ProxyInvocationHandler // this handler implements
//InvocationHandler interface
val impl = Proxy.newProxyInstance(
Class.forName(classOf[Iface].getName).getClassLoader(),
Class.forName(classOf[Iface].getName).getClasses,
handler
).asInstanceOf[Iface]
But here the compiler says that
$Proxy0 cannot be cast to xxx.yyy.Zzz$Iface
How can I do this with proxy, in a short way.