You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Jeremy Hughes (JIRA)" <ji...@apache.org> on 2009/12/14 22:12:18 UTC
[jira] Commented: (ARIES-82) BeanRecipe fails when using generics
[ https://issues.apache.org/jira/browse/ARIES-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790372#action_12790372 ]
Jeremy Hughes commented on ARIES-82:
------------------------------------
I suspect this is because the FactoryBean interface defines an "Object getObject()" method and SpringFactoryBean implements a "Spring getObject()". It looks like Aries Blueprint is finding both the interface method and the impl method on SpringFactoryBean and treating them as different.
> BeanRecipe fails when using generics
> ------------------------------------
>
> Key: ARIES-82
> URL: https://issues.apache.org/jira/browse/ARIES-82
> Project: Aries
> Issue Type: Bug
> Components: Blueprint
> Reporter: Oliver Lietz
> Attachments: test.tar.gz
>
>
> public class SpringFactoryBean implements FactoryBean<Spring> {
> public Spring getObject() throws Exception {
> return new Primavera();
> }
> public Class<? extends Spring> getObjectType() {
> return Primavera.class;
> }
> public boolean isSingleton() {
> return false;
> }
> }
> <?xml version="1.0" encoding="UTF-8"?>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
> <bean id="springFactory" class="com.example.testing.aries.blueprint.springfactorybean.SpringFactoryBean"/>
> <bean id="spring" factory-ref="springFactory" factory-method="getObject"/>
> <service ref="spring" interface="com.example.testing.aries.blueprint.springfactorybean.Spring"/>
> </blueprint>
> [pool-1-thread-1] ERROR org.apache.aries.blueprint.container.BlueprintContainerImpl - Unable to start blueprint container for bundle com.example.testing.aries.blueprint.springfactorybean
> org.osgi.service.blueprint.container.ComponentDefinitionException: Multiple matching factory methods getObject found on class com.example.testing.aries.blueprint.springfactorybean.SpringFactoryBean for arguments [] when instanciating bean spring: [public java.lang.Object com.example.testing.aries.blueprint.springfactorybean.SpringFactoryBean.getObject() throws java.lang.Exception, public com.example.testing.aries.blueprint.springfactorybean.Spring com.example.testing.aries.blueprint.springfactorybean.SpringFactoryBean.getObject() throws java.lang.Exception]
> at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:231)
> at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:645)
> at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
> at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:212)
> at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:140)
> at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:604)
> at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:311)
> at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:211)
> [...]
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.