[JBoss JIRA] Created: (WELD-930) Producer is made an alternative if the declaring bean class is an alternative
by Alexey Kazakov (JIRA)
Producer is made an alternative if the declaring bean class is an alternative
-----------------------------------------------------------------------------
Key: WELD-930
URL: https://issues.jboss.org/browse/WELD-930
Project: Weld
Issue Type: Bug
Components: Producers (Methods, Fields and Disposers)
Affects Versions: 1.1.0.Final
Reporter: Alexey Kazakov
I'm looking at examples from https://github.com/pmuir/jboss-as-developer-guide/tree/master/quickstarts
There is org.jboss.as.quickstarts.login.EJBUserManager:
{code:title=org.jboss.as.quickstarts.login.EJBUserManager|borderStyle=solid}
...
@Named("userManager")
@RequestScoped
@Alternative
@Stateful
public class EJBUserManager implements UserManager {
...
@Produces
@Named
@RequestScoped
public List<User> getUsers() throws Exception {
...
}
...
}
{code}
And there is also another bean org.jboss.as.quickstarts.login.ManagedBeanUserManager:
{code:title=org.jboss.as.quickstarts.login.ManagedBeanUserManager|borderStyle=solid}
...
@Named("userManager")
@RequestScoped
public class ManagedBeanUserManager implements UserManager {
@SuppressWarnings("unchecked")
@Produces
@Named
@RequestScoped
public List<User> getUsers() throws Exception {
...
}
...
}
{code}
This code works in Weld even if EJBUserManager.getUsers() is not annotated @Alternative. But regarding the spec such a method has an ambiguous EL name "users":
{quote}
5.3.1. Ambiguous EL names
An ambiguous EL name exists in an EL expression when an EL name resolves to multiple beans. When an ambiguous EL
name exists, the container attempts to resolve the ambiguity. If any of the beans are alternatives, the container eliminates
all beans that are not alternatives, *except for producer methods and fields of beans that are alternatives*. If there is exactly
one bean remaining, the container will select this bean, and the ambiguous EL name is called resolvable.
{quote}
There is a comment from Pete Muir:
{quote}
This looks to me like a bug in Weld (one that crept in from a pre-final spec revision) - that it checks if the declaring bean class is an alternative, and if it is, makes the producer an alternative. Can you file a WELD issue for this? I'll update the quickstart to explicitly make the producer an alternative.
Pete
{quote}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WELD-1123) WELD-000075 error message with AspectJ
by Jean ANDRE (JIRA)
Jean ANDRE created WELD-1123:
--------------------------------
Summary: WELD-000075 error message with AspectJ
Key: WELD-1123
URL: https://issues.jboss.org/browse/WELD-1123
Project: Weld
Issue Type: Bug
Affects Versions: 1.1.4.Final
Environment: WELD-000900 1.1.4 (Final) with GlassFish 3.1.2 Open Source - commons-lang-2.4 - commons-logging-1.1.1 - cssparser-0.9.6 - el-impl-2.2 - guava-11.0.1 - hibernate-validator-4.2.0.Final - junit-4.10 - log4j-1.2.16 - richfaces-components-api-4.2.1.Final - sac-1.3 - AspectJ / AJDT for Eclipse Indigo.
Reporter: Jean ANDRE
We have an application - Without AspectJ, the application is running smoothly but as soon as we activate aspectJ, if we tried to deploy and run the application we got the following error message:
{code}
GRAVE: Exception while loading the app
GRAVE: Exception while loading the app : WELD-000075 Normal scoped managed bean implementation class has a public field: public@Named @RequestScoped class com.nested.web.controller.PanelTwoController
org.jboss.weld.exceptions.DefinitionException: WELD-000075 Normal scoped managed bean implementation class has a public field: public@Named @RequestScoped class com.nested.web.controller.PanelTwoController
at org.jboss.weld.bean.ManagedBean.checkBeanImplementation(ManagedBean.java:438)
at org.jboss.weld.bean.AbstractClassBean.initialize(AbstractClassBean.java:191)
at org.jboss.weld.bean.ManagedBean.initialize(ManagedBean.java:322)
at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:115)
at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:204)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:344)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:179)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:277)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WELD-1148) Custom transactional observer not deferred for later invocation
by Martin Kouba (JIRA)
Martin Kouba created WELD-1148:
----------------------------------
Summary: Custom transactional observer not deferred for later invocation
Key: WELD-1148
URL: https://issues.jboss.org/browse/WELD-1148
Project: Weld
Issue Type: Bug
Affects Versions: 2.0.0.Alpha2
Reporter: Martin Kouba
Custom transactional observer added via {{AfterBeanDiscovery}} event is not registered for later invocation during the transaction completion phase but invoked immediately. Weld should call {{getTransactionPhase()}} to handle custom observer properly.
{quote}
10.5. Observer notification:
For a custom implementation of the ObserverMethod interface defined in Section 11.1.3, "The ObserverMethod interface",
the container must call {{getReception()}} and {{getTransactionPhase()}} to determine if the observer method is a conditional
or transactional observer method, and {{notify()}} to invoke the method.
{quote}
See TCK test:
{{org.jboss.cdi.tck.tests.event.observer.transactional.custom.CustomTransactionalObserverTest}}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months