Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0.0-alpha-2
-
None
Description
Sometimes callers of EjbDefinitionUtility.defineEjbBeanProxy() will have to pass the local bean class, when @LocalBean is the only valid local business "interface".
But, we can't pass the bean class to the proxyFactory.setInterfaces() as this causes an exeption in javassist since it's not really an interface that can be implemented. On my stack, I see
Caused by: java.lang.RuntimeException: by java.lang.IncompatibleClassChangeError: foo.classWithLocalBeanView
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:509)
at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:486)
at javassist.util.proxy.ProxyFactory.createClass1(ProxyFactory.java:422)
at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:394)
at org.apache.webbeans.util.SecurityUtil$PrivilegedActionForProxyFactory.run(SecurityUtil.java:301)
at java.security.AccessController.doPrivileged(AccessController.java:202)
at org.apache.webbeans.util.SecurityUtil.doPrivilegedCreateClass(SecurityUtil.java:184)
at org.apache.webbeans.proxy.JavassistProxyFactory.defineEjbBeanProxyClass(JavassistProxyFactory.java:149)
at org.apache.webbeans.ejb.common.util.EjbDefinitionUtility.defineEjbBeanProxy(EjbDefinitionUtility.java:73)
Simply calling proxyFactory.setSuperClass() seems sufficient and makes sense.