org.h2.jdbc.JdbcSQLException: Feld "lastSeen" nicht gefunden Column "lastSeen" not found [42122-176]

GitHub | mozzbozz | 4 months ago
  1. 0

    GitHub comment 230#237003937

    GitHub | 4 months ago | mozzbozz
    org.h2.jdbc.JdbcSQLException: Feld "lastSeen" nicht gefunden Column "lastSeen" not found [42122-176]
  2. 0

    liquibase.database.AbstractDatabase.escapeColumnName() doesn't correctly escape all column names. Here's how to reproduce the issue with an H2 database: Create this table: {code:sql} CREATE TABLE x ( "WHITE SPACE" INT ) {code} Run this code snippet {code:java} Class.forName("org.h2.Driver"); Connection connection = DriverManager.getConnection("jdbc:h2:~/test", "sa", ""); H2Database database = new H2Database(); database.setConnection(new JdbcConnection(connection)); DatabaseSnapshot snapshot = DatabaseSnapshotGeneratorFactory .getInstance() .createSnapshot(database, "PUBLIC", null); {code} I then get this stack trace: {code} liquibase.exception.DatabaseException: org.h2.jdbc.JdbcSQLException: Feld "WHITE" nicht gefunden Column "WHITE" not found; SQL statement: SELECT WHITE SPACE FROM PUBLIC.X WHERE 1 = 0 [42122-170] at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(JdbcDatabaseSnapshotGenerator.java:251) at liquibase.snapshot.DatabaseSnapshotGeneratorFactory.createSnapshot(DatabaseSnapshotGeneratorFactory.java:69) at org.jooq.test.liquibase2jooq.Adapters.before(Adapters.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.h2.jdbc.JdbcSQLException: Feld "WHITE" nicht gefunden Column "WHITE" not found; SQL statement: SELECT WHITE SPACE FROM PUBLIC.X WHERE 1 = 0 [42122-170] at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) at org.h2.message.DbException.get(DbException.java:169) at org.h2.message.DbException.get(DbException.java:146) at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:141) at org.h2.expression.Alias.optimize(Alias.java:47) at org.h2.command.dml.Select.prepare(Select.java:799) at org.h2.command.Parser.prepareCommand(Parser.java:218) at org.h2.engine.Session.prepareLocal(Session.java:414) at org.h2.engine.Session.prepareCommand(Session.java:363) at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:70) at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.isColumnAutoIncrement(JdbcDatabaseSnapshotGenerator.java:842) at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.readColumns(JdbcDatabaseSnapshotGenerator.java:369) at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(JdbcDatabaseSnapshotGenerator.java:244) ... 17 more {code} This can probably be reproduced with any database

    JIRA | 4 years ago | Lukas Eder
    liquibase.exception.DatabaseException: org.h2.jdbc.JdbcSQLException: Feld "WHITE" nicht gefunden Column "WHITE" not found; SQL statement: SELECT WHITE SPACE FROM PUBLIC.X WHERE 1 = 0 [42122-170]
  3. 0

    liquibase.database.AbstractDatabase.escapeColumnName() doesn't correctly escape all column names. Here's how to reproduce the issue with an H2 database: Create this table: {code:sql} CREATE TABLE x ( "WHITE SPACE" INT ) {code} Run this code snippet {code:java} Class.forName("org.h2.Driver"); Connection connection = DriverManager.getConnection("jdbc:h2:~/test", "sa", ""); H2Database database = new H2Database(); database.setConnection(new JdbcConnection(connection)); DatabaseSnapshot snapshot = DatabaseSnapshotGeneratorFactory .getInstance() .createSnapshot(database, "PUBLIC", null); {code} I then get this stack trace: {code} liquibase.exception.DatabaseException: org.h2.jdbc.JdbcSQLException: Feld "WHITE" nicht gefunden Column "WHITE" not found; SQL statement: SELECT WHITE SPACE FROM PUBLIC.X WHERE 1 = 0 [42122-170] at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(JdbcDatabaseSnapshotGenerator.java:251) at liquibase.snapshot.DatabaseSnapshotGeneratorFactory.createSnapshot(DatabaseSnapshotGeneratorFactory.java:69) at org.jooq.test.liquibase2jooq.Adapters.before(Adapters.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.h2.jdbc.JdbcSQLException: Feld "WHITE" nicht gefunden Column "WHITE" not found; SQL statement: SELECT WHITE SPACE FROM PUBLIC.X WHERE 1 = 0 [42122-170] at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) at org.h2.message.DbException.get(DbException.java:169) at org.h2.message.DbException.get(DbException.java:146) at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:141) at org.h2.expression.Alias.optimize(Alias.java:47) at org.h2.command.dml.Select.prepare(Select.java:799) at org.h2.command.Parser.prepareCommand(Parser.java:218) at org.h2.engine.Session.prepareLocal(Session.java:414) at org.h2.engine.Session.prepareCommand(Session.java:363) at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:70) at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.isColumnAutoIncrement(JdbcDatabaseSnapshotGenerator.java:842) at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.readColumns(JdbcDatabaseSnapshotGenerator.java:369) at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(JdbcDatabaseSnapshotGenerator.java:244) ... 17 more {code} This can probably be reproduced with any database

    JIRA | 4 years ago | Lukas Eder
    liquibase.exception.DatabaseException: org.h2.jdbc.JdbcSQLException: Feld "WHITE" nicht gefunden Column "WHITE" not found; SQL statement: SELECT WHITE SPACE FROM PUBLIC.X WHERE 1 = 0 [42122-170]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Check for Permissible Sort Properties

    GitHub | 2 months ago | ghillert
    org.h2.jdbc.JdbcSQLException: Feld "NAME" nicht gefunden Column "NAME" not found; SQL statement: SELECT LIMIT 0 5 DEFINITION_NAME, DEFINITION FROM STREAM_DEFINITIONS ORDER BY name DESC [42122-192]
  6. 0

    Missing information in Ebean-Stacktrace

    Stack Overflow | 5 years ago | niels
    org.h2.jdbc.JdbcSQLException: Feld "BYLOGINNAME" nicht gefunden Column "BYLOGINNAME" not found; SQL statement: select t0.id c0, t0.loginname c1, t0.email_address c2, t0.lastname c3, t0.firstname c4, t0.description c5, t0.enabled c6, t0.login_failed_count c7, t0.expired_date c8, t0.password c9, t0.last_update c10 from psec_user t0 where byLoginname = ? [42122-158]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.h2.jdbc.JdbcSQLException

      Feld "lastSeen" nicht gefunden Column "lastSeen" not found [42122-176]

      at org.h2.message.DbException.getJdbcSQLException()
    2. H2 Database Engine
      JdbcResultSet.findColumn
      1. org.h2.message.DbException.getJdbcSQLException(DbException.java:344)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2. org.h2.message.DbException.get(DbException.java:178)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      3. org.h2.message.DbException.get(DbException.java:154)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      4. org.h2.jdbc.JdbcResultSet.getColumnIndex(JdbcResultSet.java:3122)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      5. org.h2.jdbc.JdbcResultSet.findColumn(JdbcResultSet.java:182)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      5 frames
    3. ORMLite JDBC
      JdbcDatabaseResults.findColumn
      1. com.j256.ormlite.jdbc.JdbcDatabaseResults.findColumn(JdbcDatabaseResults.java:90)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      1 frame
    4. ORMLite Core
      BaseMappedQuery.mapRow
      1. com.j256.ormlite.field.FieldType.resultToJava(FieldType.java:815)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2. com.j256.ormlite.stmt.mapped.BaseMappedQuery.mapRow(BaseMappedQuery.java:60)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2 frames
    5. ORMLite JDBC
      JdbcDatabaseConnection.queryForOne
      1. com.j256.ormlite.jdbc.JdbcDatabaseConnection.queryForOne(JdbcDatabaseConnection.java:283)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2. com.j256.ormlite.jdbc.JdbcDatabaseConnection.queryForOne(JdbcDatabaseConnection.java:201)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2 frames
    6. ORMLite Core
      BaseMappedQuery.mapRow
      1. com.j256.ormlite.stmt.mapped.MappedQueryForId.execute(MappedQueryForId.java:38)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2. com.j256.ormlite.field.FieldType.assignField(FieldType.java:558)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      3. com.j256.ormlite.stmt.mapped.BaseMappedQuery.mapRow(BaseMappedQuery.java:71)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      3 frames
    7. ORMLite JDBC
      JdbcDatabaseConnection.queryForOne
      1. com.j256.ormlite.jdbc.JdbcDatabaseConnection.queryForOne(JdbcDatabaseConnection.java:283)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2. com.j256.ormlite.jdbc.JdbcDatabaseConnection.queryForOne(JdbcDatabaseConnection.java:201)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2 frames
    8. ORMLite Core
      BaseDaoImpl.queryForAll
      1. com.j256.ormlite.stmt.mapped.MappedQueryForId.execute(MappedQueryForId.java:38)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2. com.j256.ormlite.field.FieldType.assignField(FieldType.java:558)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      3. com.j256.ormlite.stmt.mapped.BaseMappedQuery.mapRow(BaseMappedQuery.java:71)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      4. com.j256.ormlite.stmt.SelectIterator.getCurrent(SelectIterator.java:270)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      5. com.j256.ormlite.stmt.SelectIterator.nextThrow(SelectIterator.java:161)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      6. com.j256.ormlite.stmt.StatementExecutor.query(StatementExecutor.java:202)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      7. com.j256.ormlite.stmt.StatementExecutor.queryForAll(StatementExecutor.java:118)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      8. com.j256.ormlite.dao.BaseDaoImpl.queryForAll(BaseDaoImpl.java:241)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      8 frames
    9. org.mycontroller.standalone
      V1_02_08__2016_Jul_01.migrate
      1. org.mycontroller.standalone.db.dao.BaseAbstractDaoImpl.getAll(BaseAbstractDaoImpl.java:252)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2. org.mycontroller.standalone.db.migration.V1_02_08__2016_Jul_01.migrate(V1_02_08__2016_Jul_01.java:74)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2 frames
    10. ${project.artifactId}
      Flyway.migrate
      1. org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:45)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2. org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:284)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      3. org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:282)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      4. org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      5. org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:282)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      6. org.flywaydb.core.internal.command.DbMigrate.access$800(DbMigrate.java:46)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      7. org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:207)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      8. org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:156)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      9. org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      10. org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:156)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      11. org.flywaydb.core.Flyway$1.execute(Flyway.java:1059)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      12. org.flywaydb.core.Flyway$1.execute(Flyway.java:1006)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      13. org.flywaydb.core.Flyway.execute(Flyway.java:1418)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      14. org.flywaydb.core.Flyway.migrate(Flyway.java:1006)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      14 frames
    11. org.mycontroller.standalone
      StartApp.main
      1. org.mycontroller.standalone.db.DataBaseUtils.loadDatabase(DataBaseUtils.java:118)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      2. org.mycontroller.standalone.StartApp.startServices(StartApp.java:243)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      3. org.mycontroller.standalone.StartApp.startMycontroller(StartApp.java:106)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      4. org.mycontroller.standalone.StartApp.main(StartApp.java:93)[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]
      4 frames