Results 1 to 4 of 4

Thread: No constructor with 1 argument defined in class ‘org.springframework.jdbc.config.Sort

  1. #1
    Join Date
    Apr 2010
    Posts
    12

    Default No constructor with 1 argument defined in class ‘org.springframework.jdbc.config.Sort

    In a Spring 3.0 configuration file, I have:
    Code:
    <jdbc:embedded-database id="dataSource">
        <jdbc:script location="classpath:rewards/testdb/schema.sql"/>
        <jdbc:script location="classpath:rewards/testdb/test-data.sql"/>
     </jdbc:embedded-database>
    This gets me an error in STS 2.5.1: “No constructor with 1 argument defined in class ‘org.springframework.jdbc.config.SortedResourcesFa ctoryBean’”

    This same project worked in a previous setup, with STS 2.3.3 (in fact, it's part of the Core Spring training materials). I'm sure it's something stupid I did, but I just don't have the first clue where to start working around this. Help interpreting this and pointing me in the right direction? Thanks.

  2. #2

    Default

    Hi,
    try passing all the resourse's as a collection that may help you out.
    try as below.
    Code:
    <property name="jdbc:script">
    <list>
    <value>"classpath:rewards/testdb/schema.sql"</value>
    <value>"classpath:rewards/testdb/test-data.sql"</value>
    </list>
    </property>
    confirm back if that work out

    HTH
    narayan

  3. #3
    Join Date
    Apr 2010
    Posts
    12

    Default

    No, that doesn't work. The error is then:
    cvc-complex-type.2.4.a: Invalid content was found starting with element 'property'. One of '{"http://www.springframework.org/schema/jdbc":script}' is expected.

    So the original XML itself looks valid (which is good since it worked previously). Something behind the scenes is evidently trying to use SortedResourcesFactoryBean to create something with the wrong number of constructor arguments - at compile time, mind you.

    Any idea how to find out what it is?

  4. #4
    Join Date
    Apr 2010
    Posts
    12

    Default

    I think this is probably an STS error. When I run an actual test case using this config it completes fine.

Posting Permissions

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