title: Pass parameters to Spring MethodInvokingFactoryBean arguments list
body: <p>I am trying to find the way to pass objects to <code>Spring</code> <code>MethodInvokingFactoryBean</code> arguments list. Here is my <code>Spring</code> configuration:</p>
  
  <pre><code>&lt;bean id="qName" class="javax.xml.namespace.QName"&gt;
      &lt;constructor-arg index="0" value="${com.groupgti.esb.online.tests.talentq.tns}"/&gt;
      &lt;constructor-arg index="1" value="${com.groupgti.esb.online.tests.talentq.serviceName}"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="wsdlUrl" class="java.net.URL"&gt;
      &lt;constructor-arg index="0" value="${com.groupgti.esb.online.tests.talentq.url}"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="service" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"&gt;
      &lt;property name="targetObject"&gt;
          &lt;bean id="serviceObject" class="com.groupgti.onlinetest.talentq.jaxb.TQIntegrationV2"/&gt;
      &lt;/property&gt;
      &lt;property name="targetMethod"&gt;
          &lt;value&gt;create&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="arguments"&gt;
          &lt;list&gt;
              &lt;value type="java.net.URL"&gt;wsdlUrl&lt;/value&gt;
              &lt;value type="javax.xml.namespace.QName"&gt;qName&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>This is not working:</p>
  
  <pre><code>&lt;value type="java.net.URL"&gt;wsdlUrl&lt;/value&gt;
  &lt;value type="javax.xml.namespace.QName"&gt;qName&lt;/value&gt;
  </code></pre>
  
  <p>I am getting the exception:</p>
  
  <pre><code>Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.net.URL'; nested exception is java.lang.IllegalArgumentException: Could not retrieve URL for OSGi resource[wsdlUrl|bnd.id=573|bnd.sym=com.groupgti.esb.online.tests.talentq]: OSGi resource[wsdlUrl|bnd.id=573|bnd.sym=com.groupgti.esb.online.tests.talentq] cannot be resolved to URL because it does not exist
  </code></pre>
  
  <p>This is because parameter is passed as <code>String</code>, just <code>wsdlUrl</code> and not as an <code>java.net.URL</code> object.</p>
  
  <p>I have also tried this:</p>
  
  <pre><code>&lt;property name="arguments"&gt;
      &lt;ref bean="wsdlUrl"/&gt;
      &lt;ref bean="qName"/&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p>This gives me an exception that <code>ref</code> attribute does not belong here. So how then should I pass an object to arguments list?</p>