Issue Type: Feature Request Feature Request
Affects Versions: 1.1.8.Final
Assignee: Unassigned
Created: 15/Jun/12 1:41 AM
Description:

There is an opportunity for a usability improvement in Weld's error messages regarding circular dependencies.

If a circular dependency exists between two unproxyable classes (ie @Dependent scope classes or those in a custom pseudo-scope) then WELD-001443 is raised during deployment scanning. This exception helpfully reports the circular dependency path, but doesn't identify the field(s) involved and the class that each is defined in.

This makes diagnosis harder than it could be, especially when one or more of the dependencies arises in the parent class of a bean. For example, in the following, it turned out that ModuleHomeScreen did depend on NymmVaadinApplication, but did so via the parent class of ModuleHomeScreen; there was no explicit dependency in ModuleHomeScreen.

This threw me for a few minutes because ModuleHomeScreen does have an event producer that's observed by NymmVaadinApplication, so I was wondering if that was violating the circular dependency rules too - even though it didn't seem to make much sense. It took a little while to realise the dependency was in the superclass.

If the error message had identified the depending field(s) at each node in the path, it would've been immediately clear what was going on.

org.jboss.weld.exceptions.DeploymentException: WELD-001443 Pseudo scoped bean has circular dependencies. Dependency path [Managed Bean [class au.com.postnewspapers.nymm.ui.ModuleHomeScreen] with qualifiers [@Any @Default], Managed Bean [class au.com.postnewspapers.nymm.ui.NymmVaadinApplication] with qualifiers [@Any @Default], Managed Bean [class au.com.postnewspapers.nymm.ui.ModuleHomeScreen] with qualifiers [@Any @Default]]
	at org.jboss.weld.bootstrap.Validator.reallyValidatePseudoScopedBean(Validator.java:564)
	at org.jboss.weld.bootstrap.Validator.validatePseudoScopedInjectionPoint(Validator.java:588)
	at org.jboss.weld.bootstrap.Validator.reallyValidatePseudoScopedBean(Validator.java:571)
	at org.jboss.weld.bootstrap.Validator.validatePseudoScopedInjectionPoint(Validator.java:588)
	at org.jboss.weld.bootstrap.Validator.reallyValidatePseudoScopedBean(Validator.java:571)
	at org.jboss.weld.bootstrap.Validator.validatePseudoScopedBean(Validator.java:550)
	at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:114)
	at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:127)
	at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:346)
	at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:331)
	at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)
	at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)
	at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)
Environment: JDK 1.7, JBoss AS 7.1.1.Final
Project: Weld
Labels: error_handling error_message errors cdi weld usability
Priority: Minor Minor
Reporter: Craig Ringer
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira