Announcement Announcement Module
Collapse
No announcement yet.
Trouble running the Spring MVC step by step sample Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trouble running the Spring MVC step by step sample

    I am trying to run the step by step sample of a spring application.
    Everything is working fine until here. http://www.springframework.org/docs/...ep-Part-4.html
    I am stuck on the hsql database part. I included the hsqldb.jar in my library /WEB-INB/lib.
    I tried to run the createTables ant script which shows successfully executed.

    Buildfile: C:\Program Files\eclipse\workspace\springapp\build.xml
    createTables:
    [echo] CREATE TABLES USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
    [sql] Executing commands
    [sql] 2 of 2 SQL statements executed successfully

    Next I tried to run the loadData script which gives the following error

    [sql] Failed to execute: INSERT INTO products (id, description, price) values(1, 'Lamp', 5.78)
    [sql] java.sql.SQLException: Table not found in statement [ INSERT INTO products]
    [sql] Failed to execute: INSERT INTO products (id, description, price) values(2, 'Table', 75.29)
    [sql] java.sql.SQLException: Table not found in statement [ INSERT INTO products]
    [sql] Failed to execute: INSERT INTO products (id, description, price) values(3, 'Chair', 22.81); COMMIT; SHUTDOWN
    [sql] java.sql.SQLException: Table not found in statement [ INSERT INTO products]

    I have never worked on the hsql database before. Is there anything additional I have to do beyond the steps mentioned in the sample steps.

    Please tell me what I need to do to run hsql db.

    Regs
    Thomas

  • #2
    Solution

    Hello Regs,
    I had the same error. To resolve it, I ran
    'ant createTables loadData printData' all together instead of one after the other and it worked. Either from the command line or from eclipse (right click on build.xml, choose Run As, pick "2. Ant Build..." and check all three targets).

    createTables:
    [echo] CREATE TABLES USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
    [sql] Executing commands
    [sql] 2 of 2 SQL statements executed successfully
    loadData:
    [echo] LOAD DATA USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
    [sql] Executing commands
    [sql] 5 of 5 SQL statements executed successfully
    printData:
    [echo] PRINT DATA USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
    [sql] Executing commands
    [sql] ID,DESCRIPTION,PRICE
    [sql] 1,Lamp,5.78
    [sql] 2,Table,75.29
    [sql] 3,Chair,22.81
    [sql] 0 rows affected
    [sql] 1 of 1 SQL statements executed successfully
    BUILD SUCCESSFUL

    Good luck.

    Pat

    Comment

    Working...
    X