[ 
https://issues.apache.org/jira/browse/OWB-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832170#action_12832170
 ] 

Gurkan Erdogdu commented on OWB-273:
------------------------------------

As you said disposal methods are not cleared when @Alternative on. Currently it 
throws Exception because of not finding producers. I have applied your tests 
and did small correction. Thanks; I try to commit but SVN is off :(

> Given class is not annotated with @Alternative Exception when try to enable 
> alternative producer/producer field beans
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: OWB-273
>                 URL: https://issues.apache.org/jira/browse/OWB-273
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: M3
>            Reporter: YING WANG
>            Assignee: Gurkan Erdogdu
>            Priority: Minor
>         Attachments: alternative2.jar
>
>
> I have an alternative producer bean as follow. It seems that the 
> AlternativesManager.addClazzAlternative( ) requires @Alternative to be 
> annotated at the class level even if it is an alternative producer and throws 
> the following exception.  
> It is not necessary to add @Alternative at both class level and method level 
> for a producer/producer field beans, right?
> =====EXCEPTION=======================================================================================
>                                  
> org.apache.webbeans.exception.WebBeansConfigurationException: Given class : 
> com.jcdi.test.alternative.producerbased.AlternativeBeanProducer2 is not 
> annotated with @Alternative
>         at 
> org.apache.webbeans.inject.AlternativesManager.addClazzAlternative(AlternativesManager.java:89)
>         at 
> org.apache.webbeans.xml.WebBeansXMLConfigurator.addAlternative(WebBeansXMLConfigurator.java:622)
>         at 
> org.apache.webbeans.xml.WebBeansXMLConfigurator.configureAlternativesElement(WebBeansXMLConfigurator.java:587)
>         at 
> org.apache.webbeans.xml.WebBeansXMLConfigurator.configureSpecSpecific(WebBeansXMLConfigurator.java:323)
>         at 
> org.apache.webbeans.xml.WebBeansXMLConfigurator.configureSpecSpecific(WebBeansXMLConfigurator.java:221)
>         at 
> org.apache.webbeans.xml.WebBeansXMLConfigurator.configure(WebBeansXMLConfigurator.java:157)
>         at 
> org.apache.webbeans.config.BeansDeployer.deployFromXML(BeansDeployer.java:384)
>         at 
> org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:139)
>         at 
> org.apache.webbeans.lifecycle.WebApplicationLifeCycle.applicationStarted(WebApplicationLifeCycle.java:196)
>         at 
> org.apache.webbeans.servlet.WebBeansConfigurationListener.contextInitialized(WebBeansConfigurationListener.java:60)
> ===THE ALTERNATIVE PRODUCER 
> BEAN===============================================================
> public class AlternativeBeanProducer2 {
>       public @Produces @Alternative @QualifierProducerBased IProducedBean 
>               generateBean2(@New AlternativeBeanClass1 beanClass) {
>                       return new AbstractProducedBean(beanClass, this);
>       }
> /*    
>       public void dumpBean2(
>                       @Disposes @QualifierProducer IProducedBean bean, ILog 
> log) {
>                       log.log(bean + " is dumped by 
> AlternativeBeanProducer2");
>       }
> */ 
>       
> }
> ========================================================================

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to