org.obiba.magma.MagmaRuntimeException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `integration_app` ADD `barcode` VARCHAR

JIRA | Philippe Laflamme | 7 years ago
  1. 0

    Connecting the JDBC datasource on a MySQL instance in the integration app fails with the following error. The problem is caused because the SQL type of the column is "VARCHAR". In MySQL, these columns must have a size specified (ie: VARCHAR(255) ). Stacktrace: Exception in thread "main" org.obiba.magma.MagmaRuntimeException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `integration_app` ADD `barcode` VARCHAR at org.obiba.magma.datasource.jdbc.JdbcValueTableWriter$JdbcVariableWriter.close(JdbcValueTableWriter.java:140) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:129) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:116) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:106) at org.obiba.magma.integration.IntegrationApp.main(IntegrationApp.java:152) Caused by: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `integration_app` ADD `barcode` VARCHAR at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:55) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86) at liquibase.change.AbstractChange.execute(AbstractChange.java:247) at liquibase.change.AbstractChange.executeStatements(AbstractChange.java:93) at org.obiba.magma.datasource.jdbc.JdbcValueTableWriter$JdbcVariableWriter.close(JdbcValueTableWriter.java:137) ... 4 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:734) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48) ... 8 more

    JIRA | 7 years ago | Philippe Laflamme
    org.obiba.magma.MagmaRuntimeException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `integration_app` ADD `barcode` VARCHAR
  2. 0

    Connecting the JDBC datasource on a MySQL instance in the integration app fails with the following error. The problem is caused because the SQL type of the column is "VARCHAR". In MySQL, these columns must have a size specified (ie: VARCHAR(255) ). Stacktrace: Exception in thread "main" org.obiba.magma.MagmaRuntimeException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `integration_app` ADD `barcode` VARCHAR at org.obiba.magma.datasource.jdbc.JdbcValueTableWriter$JdbcVariableWriter.close(JdbcValueTableWriter.java:140) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:129) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:116) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:106) at org.obiba.magma.integration.IntegrationApp.main(IntegrationApp.java:152) Caused by: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `integration_app` ADD `barcode` VARCHAR at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:55) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86) at liquibase.change.AbstractChange.execute(AbstractChange.java:247) at liquibase.change.AbstractChange.executeStatements(AbstractChange.java:93) at org.obiba.magma.datasource.jdbc.JdbcValueTableWriter$JdbcVariableWriter.close(JdbcValueTableWriter.java:137) ... 4 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:734) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48) ... 8 more

    JIRA | 7 years ago | Philippe Laflamme
    org.obiba.magma.MagmaRuntimeException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `integration_app` ADD `barcode` VARCHAR
  3. 0

    1) Start Opal 2) Export a ValueTable that has many attributes (ex: Participants) to a JdbcDatasource: export -d sql-datasource opal-data.Participants If your ValueTable has enough attributes, you should get this error: org.springframework.jdbc.UncategorizedSQLException: ConnectionCallback; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024); nested exception is java.sql.SQLException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:349) at org.obiba.magma.datasource.jdbc.JdbcDatasource.doWithDatabase(JdbcDatasource.java:163) at org.obiba.magma.datasource.jdbc.JdbcValueTableWriter$JdbcVariableWriter.close(JdbcValueTableWriter.java:125) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:130) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:117) at org.obiba.opal.core.service.impl.DefaultExportServiceImpl.exportTablesToDatasource(DefaultExportServiceImpl.java:69) at org.obiba.opal.core.service.impl.DefaultExportServiceImpl.exportTablesToDatasource(DefaultExportServiceImpl.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy40.exportTablesToDatasource(Unknown Source) at org.obiba.opal.cli.client.command.ExportCommand.execute(ExportCommand.java:31) at org.obiba.opal.cli.client.OpalConsole.prompt(OpalConsole.java:136) at org.obiba.opal.cli.client.OpalConsole.<init>(OpalConsole.java:103) at org.obiba.opal.cli.client.OpalConsole.main(OpalConsole.java:185) Caused by: java.sql.SQLException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024) at org.obiba.magma.datasource.jdbc.JdbcDatasource$2.doInConnection(JdbcDatasource.java:169) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:342) ... 21 more Caused by: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:55) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86) at liquibase.change.AbstractChange.execute(AbstractChange.java:247) at liquibase.change.AbstractChange.executeStatements(AbstractChange.java:93) at org.obiba.magma.datasource.jdbc.JdbcDatasource$ChangeDatabaseCallback.doInDatabase(JdbcDatasource.java:211) at org.obiba.magma.datasource.jdbc.JdbcDatasource$2.doInConnection(JdbcDatasource.java:167) ... 22 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2637) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2566) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:782) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:625) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48) ... 27 more

    JIRA | 7 years ago | Martin Boulanger
    org.springframework.jdbc.UncategorizedSQLException: ConnectionCallback; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024); nested exception is java.sql.SQLException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    1) Start Opal 2) Export a ValueTable that has many attributes (ex: Participants) to a JdbcDatasource: export -d sql-datasource opal-data.Participants If your ValueTable has enough attributes, you should get this error: org.springframework.jdbc.UncategorizedSQLException: ConnectionCallback; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024); nested exception is java.sql.SQLException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:349) at org.obiba.magma.datasource.jdbc.JdbcDatasource.doWithDatabase(JdbcDatasource.java:163) at org.obiba.magma.datasource.jdbc.JdbcValueTableWriter$JdbcVariableWriter.close(JdbcValueTableWriter.java:125) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:130) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:117) at org.obiba.opal.core.service.impl.DefaultExportServiceImpl.exportTablesToDatasource(DefaultExportServiceImpl.java:69) at org.obiba.opal.core.service.impl.DefaultExportServiceImpl.exportTablesToDatasource(DefaultExportServiceImpl.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy40.exportTablesToDatasource(Unknown Source) at org.obiba.opal.cli.client.command.ExportCommand.execute(ExportCommand.java:31) at org.obiba.opal.cli.client.OpalConsole.prompt(OpalConsole.java:136) at org.obiba.opal.cli.client.OpalConsole.<init>(OpalConsole.java:103) at org.obiba.opal.cli.client.OpalConsole.main(OpalConsole.java:185) Caused by: java.sql.SQLException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024) at org.obiba.magma.datasource.jdbc.JdbcDatasource$2.doInConnection(JdbcDatasource.java:169) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:342) ... 21 more Caused by: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:55) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86) at liquibase.change.AbstractChange.execute(AbstractChange.java:247) at liquibase.change.AbstractChange.executeStatements(AbstractChange.java:93) at org.obiba.magma.datasource.jdbc.JdbcDatasource$ChangeDatabaseCallback.doInDatabase(JdbcDatasource.java:211) at org.obiba.magma.datasource.jdbc.JdbcDatasource$2.doInConnection(JdbcDatasource.java:167) ... 22 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2637) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2566) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:782) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:625) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78) at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48) ... 27 more

    JIRA | 7 years ago | Martin Boulanger
    org.springframework.jdbc.UncategorizedSQLException: ConnectionCallback; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024); nested exception is java.sql.SQLException: liquibase.exception.JDBCException: Error executing SQL ALTER TABLE `Participants` ADD `BoneDensity_OUTPUT_FOOT_SCANNED` VARCHAR(1024)
  6. 0

    Test case: Any Java EE app using Hibernate, any container Specify any file with multiline SQL commands in the hibernate.hbm2ddl.import_files option, set hibernate.hbm2ddl.auto to create-drop in persistence.xml Run application org.hibernate.JDBCException: Error during import script execution at line 4 at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:370) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:276) at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:219) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:372) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:268) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:650) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1582) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:842) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:681) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:366) ... 46 more (wrong, expected: no exception) Reason: org.hibernate.tool.hbm2ddl.SchemaExport.importScript tries to execute the input script line by line. It does not seem complicated to simply concatenate consecutive lines instead (until one ending with a semicolon is found). Note that this bug is annoying not because of difficulty finding a workaround, it is annoying because the exception message is obscure.

    Hibernate JIRA | 4 years ago | Krzysztof Sierszeń
    org.hibernate.JDBCException: Error during import script execution at line 4

  1. Kialandei 1 times, last 2 weeks ago
  2. tvrmsmith 6 times, last 3 weeks ago
  3. davidvanlaatum 4 times, last 2 months ago
  4. tvrmsmith 1 times, last 3 months ago
  5. qoomon 1 times, last 4 months ago
27 more registered users
62 unregistered visitors
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. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0()
  2. Java RT
    Constructor.newInstance
    1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    4. java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    4 frames
  3. MySQL jdbc
    StatementImpl.execute
    1. com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    2. com.mysql.jdbc.Util.getInstance(Util.java:381)
    3. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
    4. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
    5. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
    6. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
    7. com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
    8. com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
    9. com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)
    10. com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
    11. com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:734)
    11 frames
  4. Commons DBCP
    DelegatingStatement.execute
    1. org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
    1 frame
  5. liquibase.database.template
    JdbcTemplate.execute
    1. liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78)
    2. liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48)
    3. liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86)
    3 frames
  6. Liquibase Core
    AbstractChange.executeStatements
    1. liquibase.change.AbstractChange.execute(AbstractChange.java:247)
    2. liquibase.change.AbstractChange.executeStatements(AbstractChange.java:93)
    2 frames
  7. org.obiba.magma
    IntegrationApp.main
    1. org.obiba.magma.datasource.jdbc.JdbcValueTableWriter$JdbcVariableWriter.close(JdbcValueTableWriter.java:137)
    2. org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:129)
    3. org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:116)
    4. org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:106)
    5. org.obiba.magma.integration.IntegrationApp.main(IntegrationApp.java:152)
    5 frames