[JBoss JIRA] Created: (CDITCK-206) Add test to verify visibly of beans registered explicitly through an extension in non-bean archives
by Dan Allen (JIRA)
Add test to verify visibly of beans registered explicitly through an extension in non-bean archives
---------------------------------------------------------------------------------------------------
Key: CDITCK-206
URL: https://issues.jboss.org/browse/CDITCK-206
Project: CDI TCK
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Tests
Affects Versions: 1.0.4.Final
Reporter: Dan Allen
Add a test that answers this question:
Can an extension register a bean programmatically for a class that resides in another non-bean archive?
This question requires a short example which is available in the OpenTCK test suite and may be ported to the CDI TCK [1].
Assume one archive, a.jar, has the following contents:
org/opentck/javaee/cdi/spi/beforebeandiscovery/BeanClassToRegister.class
A second archive, b.jar, has the following contents:
org/opentck/javaee/cdi/spi/beforebeandiscovery/AnotherBeanClassToRegister.class
org/opentck/javaee/cdi/spi/beforebeandiscovery/AnotherManualBeanRegistrationExtension.class
org/opentck/javaee/cdi/spi/beforebeandiscovery/ManualBeanRegistrationExtension.class
META-INF/services/javax.enterprise.inject.spi.Extension
AnotherBeanClassToRegister has an injection point of type BeanClassToRegister:
public class AnotherBeanClassToRegister {
@Inject
private BeanClassToRegister collaborator;
}
BeanClassToRegister and AnotherBeanClassToRegister are added as beans programmatically in respective extensions listed in the service provider descriptor:
public class ManualBeanRegistrationExtension implements Extension {
public void registerBeans(@Observes BeforeBeanDiscovery event, BeanManager bm) {
event.addAnnotatedType(bm.createAnnotatedType(BeanClassToRegister.class));
}
}
public class AnotherManualBeanRegistrationExtension implements Extension {
public void registerBeans(@Observes BeforeBeanDiscovery event, BeanManager bm) {
event.addAnnotatedType(bm.createAnnotatedType(AnotherBeanClassToRegister.class));
}
}
The two libraries, a.jar and b.jar are bundled in a web archive, test.war
WEB-INF/lib/a.jar
WEB-INF/lib/b.jar
WEB-INF/beans.xml
Deploying this archive to the reference implementation fails with an error message that the injection point from above cannot be satisfied. There appears to be a visibility problem across bean archives in this case.
Adding META-INF/beans.xml to a.jar and removing the ManualBeanRegistrationExtension from b.jar resolves the issue in the reference implementation.
[1] https://github.com/opentck/javaee_cdi/tree/master/src/test/java/org/opent...
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] Created: (WELD-878) WeldPhaseListener fails to activate conversation context if conversation is not found
by Jarkko Hyöty (JIRA)
WeldPhaseListener fails to activate conversation context if conversation is not found
-------------------------------------------------------------------------------------
Key: WELD-878
URL: https://issues.jboss.org/browse/WELD-878
Project: Weld
Issue Type: Bug
Components: Conversations, Web Tier integration (JSF, JSP, EL and Servlet)
Affects Versions: 1.1.0.Final
Environment: Glassfish 3.1 B43 updated with weld-1.1.0-SNAPSHOT (weld-osgi-bundle-1.1.0-20110329.041630-9.jar)
Reporter: Jarkko Hyöty
It seems that org.jboss.weld.jsf.WeldPhaseListener fails to activate conversation context if a conversation is not found by the supplied conversation id. This problem is potentially related to [SEAMCATCH-46],[WELD-855].
JSR-299 6.7.4 Conversation context lifecycle has a requirement that 'If the propagated conversation cannot be restored, the container _must associate the request with a new transient conversation_ and throw an exception of type javax.enterprise.context.NonexistentConversationException from the restore view phase of the JSF lifecycle.'. However, the implementation of org.jboss.weld.jsf.WeldPhaseListener.activateConversations fails to do that if a conversation is not found by the conversation id.
{code}
private void activateConversations(FacesContext facesContext)
{
ConversationContext conversationContext = instance().select(HttpConversationContext.class).get();
String cid = getConversationId(facesContext, conversationContext);
log.debug(RESUMING_CONVERSATION, cid);
if (cid != null && conversationContext.getConversation(cid) == null)
{
throw new NonexistentConversationException(NO_CONVERSATION_FOUND_TO_RESTORE, cid);
}
conversationContext.activate(cid);
}
{code}
Recovering from the exception becomes difficult since the context is not active. Typical symptom is 'java.lang.IllegalStateException: Unable to load current conversations from the associated request, something went badly wrong when associate() was called
at org.jboss.weld.context.AbstractConversationContext.getCurrentConversation(AbstractConversationContext.java:413)'
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 7 months
[JBoss JIRA] Created: (CDITCK-214) Managed bean not given a @Named annotation in Non-Contextual injection test
by Bob Nettleton (JIRA)
Managed bean not given a @Named annotation in Non-Contextual injection test
---------------------------------------------------------------------------
Key: CDITCK-214
URL: https://issues.jboss.org/browse/CDITCK-214
Project: CDI TCK
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Tests
Affects Versions: 1.0.4.Final
Reporter: Bob Nettleton
The following test case:
org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.InjectionIntoNonContextualComponentTest.testInjectionIntoJSFManagedBean
verifies that a JSF managed bean can be a target for CDI injection.
The .jsp in the test case (ManagedBeanTestPage.jsp) relies on an Expression Langage name ("farm") in order to locate this bean.
The managed bean in question:
org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.Farm
does not include a @Named annotation.
Section 2.5.3 of the CDI Specification states that:
"If @Named is not declared by the bean, nor by its stereotypes, a bean has no EL name."
Based on this line in the spec, it appears that this test may be in error. If the bean does not have an EL name, the bean cannot be located by the EL Resolver.
If my interpretation of the spec is correct here, I request that this test be excluded.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 7 months
[JBoss JIRA] Created: (CDITCK-224) Missing injection points for CircularDependencyTest
by Alexey Kazakov (JIRA)
Missing injection points for CircularDependencyTest
---------------------------------------------------
Key: CDITCK-224
URL: https://issues.jboss.org/browse/CDITCK-224
Project: CDI TCK
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Tests
Affects Versions: 1.0.4.Final
Reporter: Alexey Kazakov
It looks like that some beans tested by CircularDependencyTest miss injection points.
See org.jboss.jsr299.tck.tests.lookup.circular.NormalSelfConsumingNormalProducer, org.jboss.jsr299.tck.tests.lookup.circular.DependentSelfConsumingNormalProducer, org.jboss.jsr299.tck.tests.lookup.circular.NormalSelfConsumingDependentProducer
For instance there is a field *@SelfConsumingNormal1 Violation violation* in DependentSelfConsumingNormalProducer:
{code}
class DependentSelfConsumingNormalProducer
{
@SelfConsumingNormal1 Violation violation;
@Produces @ApplicationScoped @SelfConsumingNormal1
public Violation produceViolation() {
return new Violation();
}
public void ping() {
}
}
{code}
which should be declared as an injection point: *@Inject* @SelfConsumingNormal1 Violation violation
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 7 months
[JBoss JIRA] Created: (CDITCK-176) Decorator Elements in beans.xml use <decorator> not <class>
by Pete Muir (JIRA)
Decorator Elements in beans.xml use <decorator> not <class>
-----------------------------------------------------------
Key: CDITCK-176
URL: https://jira.jboss.org/browse/CDITCK-176
Project: CDI TCK
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Tests
Affects Versions: 1.0.2.CR2
Reporter: Pete Muir
Fix For: 1.0.2.CR3
Affected tests:
testPassivationCapableBeanWithNonPassivatingDecoratorBeanConstructorFails(org.jboss.jsr299.tck.tests.context.passivating.broken.decoratorWithNonPassivatingBeanConstructor.DecoratorWithNonPassivatingBeanConstructorTest)
testPassivationCapableBeanWithNonPassivatingInitializerInDecoratorFails(org.jboss.jsr299.tck.tests.context.passivating.broken.decoratorWithNonPassivatingInitializerMethod.DecoratorWithNonPassivatingInitializerMethodTest)
testPassivationCapableBeanWithNonPassivatingDecoratorInjectedFieldFails(org.jboss.jsr299.tck.tests.context.passivating.broken.decoratorWithNonPassivatingInjectedField.DecoratorWithNonPassivatingInjectedFieldTest)
testEnterpriseBeanWithNonPassivatingDecoratorFails(org.jboss.jsr299.tck.tests.context.passivating.broken.enterpriseBeanWithNonPassivatingDecorator.EnterpriseBeanWithNonPassivatingDecoratorTest)
testDecoratorListedTwiceInBeansXmlNotOK(org.jboss.jsr299.tck.tests.decorators.definition.broken.decoratorListedTwiceInBeansXml.DecoratorListedTwiceInBeansXmlTest)
testNonExistantDecoratorClassInBeansXmlNotOK(org.jboss.jsr299.tck.tests.decorators.definition.broken.nonExistantClassInBeansXml.NonExistantDecoratorClassInBeansXmlTest)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 7 months