You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Joe Bergmark (JIRA)" <ji...@apache.org> on 2011/04/04 23:49:05 UTC

[jira] [Created] (OWB-558) PassivationCapable bean id's for Producer Fields do not take into account generics

PassivationCapable bean id's for Producer Fields do not take into account generics
----------------------------------------------------------------------------------

                 Key: OWB-558
                 URL: https://issues.apache.org/jira/browse/OWB-558
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.0.0
            Reporter: Joe Bergmark
            Assignee: Joe Bergmark
             Fix For: 1.2.0


If you have two producer fields like:

@Produces @SessionScoped List<String> produceList1 = new ArrayList<String>();
@Produces @SessionScoped List<Integer> produceList2 = new ArrayList<Integer>();

At application startup you will get the following error:
[4/4/11 17:26:41:656 EDT] 00000028 BeansDeployer E BeansDeployer deploy 
                                 org.apache.webbeans.exception.definition.DuplicateDefinitionException: PassivationCapable bean id is not unique: PRODUCERFIELD#interface java.util.List#@javax.enterprise.inject.Any(),@javax.enterprise.inject.Default(), bean:1472604072,Name:null,WebBeans Type:PRODUCERFIELD,API Types:[java.util.Collection,java.lang.Iterable,java.lang.Object,java.util.List],Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
	at org.apache.webbeans.container.BeanManagerImpl.addPassivationInfo(BeanManagerImpl.java:366)
	at org.apache.webbeans.container.BeanManagerImpl.addBean(BeanManagerImpl.java:338)
	at org.apache.webbeans.util.WebBeansUtil.defineManagedBean(WebBeansUtil.java:3149)
	at org.apache.webbeans.config.BeansDeployer.defineManagedBean(BeansDeployer.java:881)
	at org.apache.webbeans.config.BeansDeployer.deploySingleAnnotatedType(BeansDeployer.java:536)
	at org.apache.webbeans.config.BeansDeployer.deployFromClassPath(BeansDeployer.java:482)
	at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:171)
	at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:124)
	at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:78)

This is because the ID generated:
RODUCERFIELD#interface java.util.List#@javax.enterprise.inject.Any(),@javax.enterprise.inject.Default()

Doesn't take into account any generic types.

It looks like ProducerMethods fix this by adding some additional information:
 passivatingId = id + "#" + creatorMethod.toGenericString();

We probably need to do something similar with the fields from producer fields.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (OWB-558) PassivationCapable bean id's for Producer Fields do not take into account generics

Posted by "Joe Bergmark (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bergmark resolved OWB-558.
------------------------------

    Resolution: Fixed

> PassivationCapable bean id's for Producer Fields do not take into account generics
> ----------------------------------------------------------------------------------
>
>                 Key: OWB-558
>                 URL: https://issues.apache.org/jira/browse/OWB-558
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Joe Bergmark
>            Assignee: Joe Bergmark
>             Fix For: 1.2.0
>
>
> If you have two producer fields like:
> @Produces @SessionScoped List<String> produceList1 = new ArrayList<String>();
> @Produces @SessionScoped List<Integer> produceList2 = new ArrayList<Integer>();
> At application startup you will get the following error:
> [4/4/11 17:26:41:656 EDT] 00000028 BeansDeployer E BeansDeployer deploy 
>                                  org.apache.webbeans.exception.definition.DuplicateDefinitionException: PassivationCapable bean id is not unique: PRODUCERFIELD#interface java.util.List#@javax.enterprise.inject.Any(),@javax.enterprise.inject.Default(), bean:1472604072,Name:null,WebBeans Type:PRODUCERFIELD,API Types:[java.util.Collection,java.lang.Iterable,java.lang.Object,java.util.List],Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
> 	at org.apache.webbeans.container.BeanManagerImpl.addPassivationInfo(BeanManagerImpl.java:366)
> 	at org.apache.webbeans.container.BeanManagerImpl.addBean(BeanManagerImpl.java:338)
> 	at org.apache.webbeans.util.WebBeansUtil.defineManagedBean(WebBeansUtil.java:3149)
> 	at org.apache.webbeans.config.BeansDeployer.defineManagedBean(BeansDeployer.java:881)
> 	at org.apache.webbeans.config.BeansDeployer.deploySingleAnnotatedType(BeansDeployer.java:536)
> 	at org.apache.webbeans.config.BeansDeployer.deployFromClassPath(BeansDeployer.java:482)
> 	at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:171)
> 	at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:124)
> 	at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:78)
> This is because the ID generated:
> RODUCERFIELD#interface java.util.List#@javax.enterprise.inject.Any(),@javax.enterprise.inject.Default()
> Doesn't take into account any generic types.
> It looks like ProducerMethods fix this by adding some additional information:
>  passivatingId = id + "#" + creatorMethod.toGenericString();
> We probably need to do something similar with the fields from producer fields.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OWB-558) PassivationCapable bean id's for Producer Fields do not take into account generics

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13015650#comment-13015650 ] 

Mark Struberg commented on OWB-558:
-----------------------------------

same might go for @Qualifiers

@Produces @Named("Kurt") String kurt="Kurt";  vs @Produces @Named("Karl) String karl = "Karl";

> PassivationCapable bean id's for Producer Fields do not take into account generics
> ----------------------------------------------------------------------------------
>
>                 Key: OWB-558
>                 URL: https://issues.apache.org/jira/browse/OWB-558
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Joe Bergmark
>            Assignee: Joe Bergmark
>             Fix For: 1.2.0
>
>
> If you have two producer fields like:
> @Produces @SessionScoped List<String> produceList1 = new ArrayList<String>();
> @Produces @SessionScoped List<Integer> produceList2 = new ArrayList<Integer>();
> At application startup you will get the following error:
> [4/4/11 17:26:41:656 EDT] 00000028 BeansDeployer E BeansDeployer deploy 
>                                  org.apache.webbeans.exception.definition.DuplicateDefinitionException: PassivationCapable bean id is not unique: PRODUCERFIELD#interface java.util.List#@javax.enterprise.inject.Any(),@javax.enterprise.inject.Default(), bean:1472604072,Name:null,WebBeans Type:PRODUCERFIELD,API Types:[java.util.Collection,java.lang.Iterable,java.lang.Object,java.util.List],Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]
> 	at org.apache.webbeans.container.BeanManagerImpl.addPassivationInfo(BeanManagerImpl.java:366)
> 	at org.apache.webbeans.container.BeanManagerImpl.addBean(BeanManagerImpl.java:338)
> 	at org.apache.webbeans.util.WebBeansUtil.defineManagedBean(WebBeansUtil.java:3149)
> 	at org.apache.webbeans.config.BeansDeployer.defineManagedBean(BeansDeployer.java:881)
> 	at org.apache.webbeans.config.BeansDeployer.deploySingleAnnotatedType(BeansDeployer.java:536)
> 	at org.apache.webbeans.config.BeansDeployer.deployFromClassPath(BeansDeployer.java:482)
> 	at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:171)
> 	at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:124)
> 	at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:78)
> This is because the ID generated:
> RODUCERFIELD#interface java.util.List#@javax.enterprise.inject.Any(),@javax.enterprise.inject.Default()
> Doesn't take into account any generic types.
> It looks like ProducerMethods fix this by adding some additional information:
>  passivatingId = id + "#" + creatorMethod.toGenericString();
> We probably need to do something similar with the fields from producer fields.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira