[JBoss JIRA] Created: (WELD-975) Programmatic lookup with @New qualifier not working
by Martin Kouba (JIRA)
Programmatic lookup with @New qualifier not working
---------------------------------------------------
Key: WELD-975
URL: https://issues.jboss.org/browse/WELD-975
Project: Weld
Issue Type: Bug
Affects Versions: 1.1.2.Final
Environment: JBoss AS7
TestNG
Arquillian CR5
Reporter: Martin Kouba
According to spec: "...the @New qualifier may be used, allowing the application to obtain a @New qualified bean, as defined in Section 3.12, @New qualified beans" (CDI 1.0; chapter 5.6. Programmatic lookup).
However using programmatic lookup with @New qualifier like:
{code}
@Inject @New Instance<Foo> foo;
{code}
results in:
{code}
org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001308 Unable to resolve any beans for Types: [class org.jboss.cditck.arquillian.instance.Foo]; Bindings: [@javax.enterprise.inject.New(value=org.jboss.cditck.arquillian.instance.Foo.class)]
{code}
after trying to obtain reference via get() method.
Following code works ok:
{code}
@Inject @New Foo foo;
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] Created: (WELD-964) Unsatisfied dependency exception should differentiate between "class is not in classpath", "class is in classpath but not managed bean" and "class is in classpath and managed but not like that"
by Geoffrey De Smet (JIRA)
Unsatisfied dependency exception should differentiate between "class is not in classpath", "class is in classpath but not managed bean" and "class is in classpath and managed but not like that"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: WELD-964
URL: https://issues.jboss.org/browse/WELD-964
Project: Weld
Issue Type: Enhancement
Reporter: Geoffrey De Smet
Having an "unsatisfied dependency" can have several causes:
- The jar is not in the classpath
- The jar is in the classpath, but the beans.xml is not being picked up (for whatever reason, such as problems with WEB-INF/beans.xml on some containers)
- The jar is in the classpath, the beans.xml is picked up but the qualifiers etc don't match.
So, instead of just saying "unsatisfied dependency ...": it should say something like this:
- Unsatisfied dependency ... and there is no concrete implementing class in the classpath.
- Unsatisfied dependency ... and the concrete implementing class(es) are not loaded as managed beans through a beans.xml.
- Unsatisfied dependency ... and none of the managed beans of the same type match.
Note: spring's exceptions differentiate between these cases (they explicitly define their appContext.xml set, so case 2 is impossible and case 1 throws a "app context file not found" exception.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] (WELD-1045) ProcessBeanAttributes not fired for interceptors and decorators
by Martin Kouba (Created) (JIRA)
ProcessBeanAttributes not fired for interceptors and decorators
---------------------------------------------------------------
Key: WELD-1045
URL: https://issues.jboss.org/browse/WELD-1045
Project: Weld
Issue Type: Bug
Reporter: Martin Kouba
Assignee: Jozef Hartinger
Fix For: 2.0.0.Alpha1
The spec (CDI 1.1) states: "The container must fire an event for each enabled bean, interceptor or decorator deployed in a bean archive, before registering the Bean object."
However ProcessBeanAttributes is not fired for interceptors and decorators.
Probably because of *BeanDeployerEnvironment.addInterceptor(InterceptorImpl<?>)* and *BeanDeployerEnvironment.addDecorator(DecoratorImpl<?>)* do not add intercetors and decorators bean to classBeanMap - the source of beans used in *org.jboss.weld.bootstrap.BeanDeployer.processBeans()*.
--
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, 6 months
[JBoss JIRA] (WELD-1115) UnserializableDependencyException with dependency on SLSB
by Marek Schmidt (JIRA)
Marek Schmidt created WELD-1115:
-----------------------------------
Summary: UnserializableDependencyException with dependency on SLSB
Key: WELD-1115
URL: https://issues.jboss.org/browse/WELD-1115
Project: Weld
Issue Type: Bug
Components: Bootstrap and Metamodel API
Affects Versions: 2.0.0.Alpha2
Environment: AS 7.1.1.Final with Weld 2.0.0.Alpha2
Reporter: Marek Schmidt
Assignee: Jozef Hartinger
Fix For: 2.0.0.Alpha3
An application containing the following beans (among others) fails to deploy with org.jboss.weld.exceptions.UnserializableDependencyException.
{code}
@SessionScoped
@Stateful
public EjbGameBean implements Serializable {
...
@Inject
RandomStatelessEjb randomStatelessEjb;
...
}
{code}
{code}
@Stateless
public class RandomStatelessEjb
{
@Inject
@Random
Instance<Integer> randomNumber;
public int getRandom() {
return randomNumber.get();
}
}
{code}
It probably shouldn't require a @Stateless session bean to be Serializable.
{noformat}
JBAS014777: Services which failed to start: service jboss.deployment.unit."weld-clustering-tests.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."weld-clustering-tests.war".WeldService: org.jboss.weld.exceptions.UnserializableDependencyException: WELD-001413 The bean Session bean [class org.jboss.weld.tests.clustering.numberguess.decorator.EjbGameBean with qualifiers [@Default @Named @Any]; local interfaces are [GameLocal] declares passivating scope but has non-serializable dependency Session bean [class org.jboss.weld.tests.clustering.numberguess.decorator.RandomStatelessEjb with qualifiers [@Any @Default]; local interfaces are [RandomStatelessEjb]
{noformat}
--
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, 6 months