[jboss-jira] [JBoss JIRA] (WFLY-8875) Improve exception when injecting EJB Local Interface Proxy loaded from two different classloaders

Tomasz Adamski (JIRA) issues at jboss.org
Sun Nov 5 18:19:00 EST 2017


     [ https://issues.jboss.org/browse/WFLY-8875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tomasz Adamski reassigned WFLY-8875:
------------------------------------

    Assignee: Tomasz Adamski


> 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
>         Environment: Deploy test-case.ear to reproducer
>            Reporter: Brad Maxwell
>            Assignee: Tomasz Adamski
>            Priority: Minor
>         Attachments: test-case.ear
>
>
> 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.5.0#75005)


More information about the jboss-jira mailing list