org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement at line 7 of resource class path resource [sql/test-data-insert.sql]: INSERT INTO [...]

Spring JIRA | Johannes Mockenhaupt | 2 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    How do I seed Spring-Security with Spring-Boot

    Stack Overflow | 3 years ago | sonoerin
    org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement at line 1 of resource URL [file:/Users/David/projects/cnet/OFAC/out/test/OFAC/data.sql]: INSERT INTO users (username, password, enabled) VALUES ('admin', '$2a$10$GVPAMYRozI08Mcll5too6.Q4M2jTO0iJVoiaVDv9pMxRqTpxNj9vO', TRUE); nested exception is org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "PRIMARY_KEY_4 ON PUBLIC.USERS(USERNAME)"; SQL statement: INSERT INTO users (username, password, enabled) VALUES ('admin', '$2a$10$GVPAMYRozI08Mcll5too6.Q4M2jTO0iJVoiaVDv9pMxRqTpxNj9vO', TRUE) [23505-172]
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Spring Boot postgresql embedded tomcat fails to start

    Stack Overflow | 3 years ago | user2880771
    org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement at line 1 of resource class path resource [org/springframework/security/core/userdetails/jdbc/users.ddl]: create table users(username varchar_ignorecase(50) not null primary key,password varchar_ignorecase(500) not null,enabled boolean not null); nested exception is org.postgresql.util.PSQLException: ERROR: type "varchar_ignorecase" does not exist Position: 29

    Root Cause Analysis

    1. org.springframework.jdbc.datasource.init.ScriptStatementFailedException

      Failed to execute SQL script statement at line 7 of resource class path resource [sql/test-data-insert.sql]: INSERT INTO [...]

      at org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript()
    2. org.springframework.jdbc
      ScriptUtils.executeSqlScript
      1. org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:474)[spring-jdbc-4.0.6.RELEASE.jar:4.0.6.RELEASE]
      1 frame