Brad Maxwell created WFLY-8875:
----------------------------------
Summary: Improve exception when injecting EJB Local Interface Proxy loaded
from two different classloaders
Key: WFLY-8875
URL:
https://issues.jboss.org/browse/WFLY-8875
Project: WildFly
Issue Type: Enhancement
Components: EE, EJB
Affects Versions: 11.0.0.Alpha1
Reporter: Brad Maxwell
Priority: Minor
If an EJB client tries to use @EJB to inject an EJB Local Proxy and the Local interface is
in two different classloaders/modules/sub-deployments, it throws the error below. It
would be helpful for the user to identify the issue if the exception indicated multiple
classloaders or class HelloWorld is loaded from multiple modules or class cast exception.
{code}
Caused by: java.lang.IllegalArgumentException: Can not set example.api.HelloWorld field
example.client.ClientSingleton.helloWorld to example.api.HelloWorld$$$view1
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:764)
at
org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:106)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:240)
at
org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:240)
at
org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:240)
at
org.jboss.as.weld.interceptors.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:100)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:240)
at
org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:240)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
... 26 more
{code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)