Announcement Announcement Module
Collapse
No announcement yet.
No constructor with 1 argument defined in class ‘org.springframework.jdbc.config.Sort Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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?

      Comment


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

        Comment

        Working...
        X