我目前正在尝试将新生成的grails WAR文件部署到tomcat服务器。但是,我在stacktrace.log中收到以下错误,因此应用程序无法启动。
2014-09-05 14:19:59,891 [ajp-bio-8009-exec-4] ERROR StackTrace - Full Stack Trace:
liquibase.exception.DatabaseException: Error executing SQL SELECT FILENAME,AUTHOR,ID,MD5SUM,DATEEXECUTED,ORDEREXECUTED,TAG,EXECTYPE FROM `DATABASECHANGELOG` ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC: Table 'aedb.databasechangelog' doesn't exist
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:142)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:150)
at liquibase.executor.jvm.JdbcExecutor.queryForList(JdbcExecutor.java:202)
at liquibase.executor.jvm.JdbcExecutor.queryForList(JdbcExecutor.java:197)
at liquibase.database.AbstractDatabase.getRanChangeSetList(AbstractDatabase.java:921)
at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:132)
at liquibase.Liquibase.listUnrunChangeSets(Liquibase.java:625)
at grails.plugin.databasemigration.MigrationRunner.runMigrations(MigrationRunner.groovy:96)
at grails.plugin.databasemigration.MigrationRunner$_autoRun_closure1.doCall(MigrationRunner.groovy:76)
at grails.plugin.databasemigration.MigrationUtils.executeInSession(MigrationUtils.groovy:133)
at grails.plugin.databasemigration.MigrationRunner.autoRun(MigrationRunner.groovy:56)
at DatabaseMigrationGrailsPlugin$_closure2.doCall(DatabaseMigrationGrailsPlugin.groovy:96)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'aedb.databasechangelog' doesn't exist
at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
at com.mysql.jdbc.Util.getInstance(Util.java:383)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2783)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1569)
at liquibase.executor.jvm.JdbcExecutor$1QueryStatementCallback.doInStatement(JdbcExecutor.java:128)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
... 12 more
我不知道原因是什么。因为在GGTS中启动应用程序是可能的,没有任何问题。也许你有个主意。谢谢你的帮助。
答案 0 :(得分:0)
我猜你在使用grails datasource environments? 如果部署到(远程)tomcat,则“开发”环境不再处于活动状态。因此没有为tomcat实例定义数据源,因此抱怨丢失的表。
答案 1 :(得分:0)
使用数据库迁移(Liquibase)时,请确保dataSource中没有dbCreate。