Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8563639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:00:20+00:00 2026-06-11T17:00:20+00:00

I am trying to find the way to pass objects to Spring MethodInvokingFactoryBean arguments

  • 0

I am trying to find the way to pass objects to Spring MethodInvokingFactoryBean arguments list. Here is my Spring configuration:

<bean id="qName" class="javax.xml.namespace.QName">
    <constructor-arg index="0" value="${com.groupgti.esb.online.tests.talentq.tns}"/>
    <constructor-arg index="1" value="${com.groupgti.esb.online.tests.talentq.serviceName}"/>
</bean>

<bean id="wsdlUrl" class="java.net.URL">
    <constructor-arg index="0" value="${com.groupgti.esb.online.tests.talentq.url}"/>
</bean>

<bean id="service" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetObject">
        <bean id="serviceObject" class="com.groupgti.onlinetest.talentq.jaxb.TQIntegrationV2"/>
    </property>
    <property name="targetMethod">
        <value>create</value>
    </property>
    <property name="arguments">
        <list>
            <value type="java.net.URL">wsdlUrl</value>
            <value type="javax.xml.namespace.QName">qName</value>
        </list>
    </property>
</bean>

This is not working:

<value type="java.net.URL">wsdlUrl</value>
<value type="javax.xml.namespace.QName">qName</value>

I am getting the exception:

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

This is because parameter is passed as String, just wsdlUrl and not as an java.net.URL object.

I have also tried this:

<property name="arguments">
    <ref bean="wsdlUrl"/>
    <ref bean="qName"/>
</property>

This gives me an exception that ref attribute does not belong here. So how then should I pass an object to arguments list?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:00:22+00:00Added an answer on June 11, 2026 at 5:00 pm

    Found a solution. I had to add <list> and then declare <ref>:

    <property name="arguments">
        <list>
            <ref bean="wsdlUrl"/>
            <ref bean="qName"/>
        </list>
    </property>
    

    Like this, everything is working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find an easy way to pass parameters from my C# class
I'm trying to find a way to pass objects to the Azure Queue. I
I am trying to find a way to pass derived-type objects with allocatable components
I'm trying to find a way to pass fout or cout to a function.
Trying to find a way to remove blank pages from a document I wrote
Trying to find a way to send a POST HTTPS request from Python to
I am trying to find a way to increment a second primary key column
I am trying to find a way to reverse a string, I've seen alternatives
I am trying to find a way to prevent the keyboard from appearing when
I'm trying to find a way to my Window 7 machine to recognize the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.