[weld-issues] [JBoss JIRA] Commented: (WELD-842) Event injection via constructor injection results in stacktrace.

Stuart Douglas (JIRA) jira-events at lists.jboss.org
Thu Jan 27 16:38:03 EST 2011


    [ https://issues.jboss.org/browse/WELD-842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578577#comment-12578577 ] 

Stuart Douglas commented on WELD-842:
-------------------------------------

HelloWorldService is not proxiable, so this is a validation error that should have been picked up by the container

> Event injection via constructor injection results in stacktrace. 
> -----------------------------------------------------------------
>
>                 Key: WELD-842
>                 URL: https://issues.jboss.org/browse/WELD-842
>             Project: Weld
>          Issue Type: Bug
>    Affects Versions: 1.1.0.Final
>            Reporter: Christopher Brock
>
> {code}
> /**
>  * @author Mike Brock .
>  */
> @ApplicationScoped
> public class HelloWorldService {
>     private  Event<ResponseEvent> responseEvent;
>     @Inject
>     public HelloWorldService(Event<ResponseEvent> responseEvent) {
>         this.responseEvent = responseEvent;
>     }
>     public void handleMessage(@Observes MessageEvent event) {
>         System.out.println("Received Message: " + event.getMessage());
>         responseEvent.fire(new ResponseEvent(event.getMessage()));
>     }
> }
> {code}
> Results in stacktrace:
> {code}
> com.google.common.collect.ComputationException: org.jboss.weld.exceptions.DefinitionException: org.jboss.errai.demos.cdi.helloworld.server.org$jboss$weld$bean-flat-ManagedBean-class_org$jboss$errai$demos$cdi$helloworld$server$HelloWorldService_$$_WeldClientProxy
> 	at com.google.common.collect.MapMaker$StrategyImpl.compute(MapMaker.java:602)
> 	at com.google.common.collect.MapMaker$StrategyImpl.compute(MapMaker.java:462)
> 	at com.google.common.collect.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2045)
> 	at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:112)
> 	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:660)
> 	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:252)
> 	at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
> 	at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:614)
> 	at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:607)
> 	at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:601)
> 	at org.jboss.errai.cdi.server.EventDispatcher.callback(EventDispatcher.java:60)
> {code}
> Thought it was a problem in our integration at first, but then I realized the problem does not happen when field injection is used for the Event.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list