You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2018/01/31 10:43:00 UTC

[jira] [Resolved] (ARIES-1098) BeanRecipe.findMatchingMethods does not support "varargs"

     [ https://issues.apache.org/jira/browse/ARIES-1098?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved ARIES-1098.
------------------------------------
    Resolution: Not A Problem
      Assignee: Guillaume Nodet

Committing to https://svn.apache.org/repos/asf/aries/trunk ...
	A	blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/pojos/VarArg.java
	A	blueprint/blueprint-core/src/test/resources/test-vararg.xml
	M	blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/WiringTest.java
	M	blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/container/BeanRecipeTest.java
Committed r1822786

You need to use a {{<list>}} element as the var arg is an array.

> BeanRecipe.findMatchingMethods does not support "varargs"
> ---------------------------------------------------------
>
>                 Key: ARIES-1098
>                 URL: https://issues.apache.org/jira/browse/ARIES-1098
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Martin Lichtin
>            Assignee: Guillaume Nodet
>            Priority: Major
>
> For example:
> 	<bean id="webServer" class="org.h2.tools.Server" factory-method="runTool"
> 		init-method="start" depends-on="jdbcDataSource">
> 		<argument value="-web" />
> 	</bean>
> with Server.runTool signature:
> public void runTool(String... args)
> gives
> org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to find a matching factory method runTool on class org.h2.tools.Server for arguments [-web] when instanciating bean webServer
> 	at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:318)[7:org.apache.aries.blueprint.core:1.1.0]
> 	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)[7:org.apache.aries.blueprint.core:1.1.0]
> 	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[7:org.apache.aries.blueprint.core:1.1.0]
> 	at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[7:org.apache.aries.blueprint.core:1.1.0]
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_25]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_25]
> 	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[7:org.apache.aries.blueprint.core:1.1.0]
> ...



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)