[seam-issues] [JBoss JIRA] (SOLDER-323) Allow constructor parameter values to be injected via XML

Hontvári József Levente (JIRA) jira-events at lists.jboss.org
Mon Apr 30 09:25:19 EDT 2012


    [ https://issues.jboss.org/browse/SOLDER-323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688802#comment-12688802 ] 

Hontvári József Levente edited comment on SOLDER-323 at 4/30/12 9:24 AM:
-------------------------------------------------------------------------

The same with int: 
{code:xml}
<concurrent:ScheduledThreadPoolExecutor>
	<s:parameters>
		<s:int>5</s:int>
	</s:parameters>
</concurrent:ScheduledThreadPoolExecutor>
{code}

The exception in this case: 
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [int] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public java.util.concurrent.ScheduledThreadPoolExecutor(int)]

Without s:int elements (only a number):
??Exception in thread "main" java.lang.RuntimeException: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean must not be null??
                
      was (Author: hontvari):
    The same with int: 
{code:xml}
<concurrent:ScheduledThreadPoolExecutor>
	<s:parameters>
		<s:int>5</s:int>
	</s:parameters>
</concurrent:ScheduledThreadPoolExecutor>
{code}

The exception in this case: 
?? org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [int] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public java.util.concurrent.ScheduledThreadPoolExecutor(int)] ??

Without s:int elements (only a number):
??Exception in thread "main" java.lang.RuntimeException: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean must not be null??
                  
> Allow constructor parameter values to be injected via XML
> ---------------------------------------------------------
>
>                 Key: SOLDER-323
>                 URL: https://issues.jboss.org/browse/SOLDER-323
>             Project: Solder
>          Issue Type: Feature Request
>            Reporter: Sam Corbett
>
> I'd like to inject a String into a constructor.
> If, for example, I had this constructor on a bean:
> {code}
> public Stock(String name) {
>     this.name = name;
> }
> {code}
> I'd like to be able to inject values into it with XML like this:
> {code}
> <my:Stock>
>     <s:parameters>
>         <s:String>XYZ</s:String>
>     </s:parameters>  
> </my:Stock> 
> {code}
> Or this:
> {code}
> <my:Stock>
>     <s:parameters>
>         <s:String>
>             <s:value>XYZ</s:value>
>         </s:String>
>     </s:parameters>  
> </my:Stock>
> {code}
> The first example currently throws an exception stating: "WELD-001408 Unsatisfied dependencies for type [String] with qualifiers [@Default]". The second throws an exception stating: "Item PARAMETER is not allowed to contain VALUE."

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the seam-issues mailing list