Results 1 to 2 of 2

Thread: Unsatisfied 'required' dependency of type [int]

  1. #1

    Unhappy Unsatisfied 'required' dependency of type [int]

    Hi,

    Using STS 2.7.1 with JDK 1.6u26 and Spring 3.1M2.

    I have a simple properties definition set as this:

    Code:
    <bean id="funky" class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
            <property name="properties">
                <props>
                    <prop key="test">1234</prop>
                </props>
            </property>
        </bean>
    I have a @Component bean with a setter defined as this:

    Code:
    @Value("${test}")
    public void setTest(final int test) {
        this.test = test;
    }
    STS flags up a warning against my setter, detailed as this:

    Code:
    Unsatisfied 'required' dependency of type [int]. Expected at least 1 matching bean
    I've tried using the bean id as well:

    Code:
    @Value("#funky[test]")
    but to no avail.

    Am I doing something wrong? The code works fine if I boot the system (i.e., Spring correctly sets the setter with the value of 1234 at runtime.)

    Thanks.

    -=david=-

  2. #2

    Default

    Just wondering if anyone else has seen this issue?

    -=david=-

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •