You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Gert Vanthienen (JIRA)" <ji...@apache.org> on 2009/07/06 19:59:14 UTC

[jira] Created: (GERONIMO-4727) Setting a parameterized pojo in blueprint throws exception

Setting a parameterized pojo in blueprint throws exception
----------------------------------------------------------

                 Key: GERONIMO-4727
                 URL: https://issues.apache.org/jira/browse/GERONIMO-4727
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
            Reporter: Gert Vanthienen


When the setter of property uses a parameterized type (e.g. *{{setLruList(LruList<PaxLoggingEvent> events)}}*) and the bean being injected is the raw type (e.g. *{{new LruList()}}*, we get: this exception:

{noformat}
org.osgi.service.blueprint.container.ComponentDefinitionException: 
Unable to convert property value from org.apache.felix.karaf.gshell.log.LruList to 
org.apache.felix.karaf.gshell.log.LruList<org.ops4j.pax.logging.spi.PaxLoggingEvent> for injection 
public void org.apache.felix.karaf.gshell.log.VmLogAppender.setEvents(org.apache.felix.karaf.gshell.log.LruList)
        at org.apache.geronimo.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:604)
        at org.apache.geronimo.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:571)
        at org.apache.geronimo.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:552)
        at org.apache.geronimo.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:501)
        at org.apache.geronimo.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:62)
        at org.apache.geronimo.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)
        at org.apache.geronimo.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:62)
        ...
{noformat}

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


[jira] Resolved: (GERONIMO-4727) Setting a parameterized pojo in blueprint throws exception

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

Guillaume Nodet resolved GERONIMO-4727.
---------------------------------------

    Resolution: Fixed

Such constructions have been explicitely forbidden.
The reason is that there is no way to make sure if the objects in the list are actually compatible with what the generic information provides.
The only way to get around such a problem is to register a custom converter to convert to the generic type.


> Setting a parameterized pojo in blueprint throws exception
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4727
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4727
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>            Reporter: Gert Vanthienen
>         Attachments: GERONIMO-4727.diff, GERONIMO-4727.diff
>
>
> When the setter of property uses a parameterized type (e.g. *{{setLruList(LruList<PaxLoggingEvent> events)}}*) and the bean being injected is the raw type (e.g. *{{new LruList()}}*, we get: this exception:
> {noformat}
> org.osgi.service.blueprint.container.ComponentDefinitionException: 
> Unable to convert property value from org.apache.felix.karaf.gshell.log.LruList to 
> org.apache.felix.karaf.gshell.log.LruList<org.ops4j.pax.logging.spi.PaxLoggingEvent> for injection 
> public void org.apache.felix.karaf.gshell.log.VmLogAppender.setEvents(org.apache.felix.karaf.gshell.log.LruList)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:604)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:571)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:552)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:501)
>         at org.apache.geronimo.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:62)
>         at org.apache.geronimo.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)
>         at org.apache.geronimo.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:62)
>         ...
> {noformat}

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


[jira] Updated: (GERONIMO-4727) Setting a parameterized pojo in blueprint throws exception

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

Gert Vanthienen updated GERONIMO-4727:
--------------------------------------

    Attachment: GERONIMO-4727.diff

This patch will give the raw type 'the benefit of the doubt' during type conversion before invoking the setter.

> Setting a parameterized pojo in blueprint throws exception
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4727
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4727
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>            Reporter: Gert Vanthienen
>         Attachments: GERONIMO-4727.diff
>
>
> When the setter of property uses a parameterized type (e.g. *{{setLruList(LruList<PaxLoggingEvent> events)}}*) and the bean being injected is the raw type (e.g. *{{new LruList()}}*, we get: this exception:
> {noformat}
> org.osgi.service.blueprint.container.ComponentDefinitionException: 
> Unable to convert property value from org.apache.felix.karaf.gshell.log.LruList to 
> org.apache.felix.karaf.gshell.log.LruList<org.ops4j.pax.logging.spi.PaxLoggingEvent> for injection 
> public void org.apache.felix.karaf.gshell.log.VmLogAppender.setEvents(org.apache.felix.karaf.gshell.log.LruList)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:604)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:571)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:552)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:501)
>         at org.apache.geronimo.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:62)
>         at org.apache.geronimo.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)
>         at org.apache.geronimo.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:62)
>         ...
> {noformat}

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


[jira] Updated: (GERONIMO-4727) Setting a parameterized pojo in blueprint throws exception

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

Gert Vanthienen updated GERONIMO-4727:
--------------------------------------

    Attachment: GERONIMO-4727.diff

> Setting a parameterized pojo in blueprint throws exception
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4727
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4727
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>            Reporter: Gert Vanthienen
>         Attachments: GERONIMO-4727.diff, GERONIMO-4727.diff
>
>
> When the setter of property uses a parameterized type (e.g. *{{setLruList(LruList<PaxLoggingEvent> events)}}*) and the bean being injected is the raw type (e.g. *{{new LruList()}}*, we get: this exception:
> {noformat}
> org.osgi.service.blueprint.container.ComponentDefinitionException: 
> Unable to convert property value from org.apache.felix.karaf.gshell.log.LruList to 
> org.apache.felix.karaf.gshell.log.LruList<org.ops4j.pax.logging.spi.PaxLoggingEvent> for injection 
> public void org.apache.felix.karaf.gshell.log.VmLogAppender.setEvents(org.apache.felix.karaf.gshell.log.LruList)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:604)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:571)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:552)
>         at org.apache.geronimo.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:501)
>         at org.apache.geronimo.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:62)
>         at org.apache.geronimo.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)
>         at org.apache.geronimo.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:62)
>         ...
> {noformat}

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