com.microsoft.sqlserver.jdbc.SQLServerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Error during upgrade, dot_containers
    via by David Petersheim,
  • We use identity generation with GenerationTyp.AUTO to support different DBMS (mssql and postgre) with a sequence generator for each Entity: {code:java} @SequenceGenerator(name = "SEQ_MY_CLASS", sequenceName = "SEQ_MY_CLASS") public class MyClass { private Integer id; .... @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_MY_CLASS") public Integer getId(){ ... } } {code} persistence.xml {code:xml} ... <property name="hibernate.hbm2ddl.auto" value="create" /> <property name="hibernate.default_schema" value="myschema" /> <property name="hibernate.default_catalog" value="mydatabase" /> <property name="hibernate.id.new_generator_mappings" value="true"/> ... {code} Hibernate generates the following SQL for creating the sequence, but MSSQL doesn't support providing catalog name on sequence creation. {code:sql} create sequence mycatalog.myschema.SEQ_MY_CLASS start with 1 increment by 50 {code} As result we receive the following Exception on wildfly startup: {code:java} 2016-06-09 13:13:30 INFO [ServerService Thread Pool -- 54] [] stdout: Hibernate: create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50 2016-06-09 13:13:30 WARN [ServerService Thread Pool -- 54] [] org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl: GenerationTarget encountered exception accepting command : Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50]: org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:63) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:567) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:551) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.performMigration(SchemaMigratorImpl.java:289) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:137) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:110) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:176) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:64) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:458) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:881) at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667) [wildfly-elytron-1.0.2.Final.jar:1.0.2.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45] at org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 'CREATE SEQUENCE' does not allow specifying the database name as a prefix to the object name. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:865) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:762) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159) at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:735) at org.jboss.jca.adapters.jdbc.WrappedStatement.execute(WrappedStatement.java:198) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:51) ... 19 more {code}
    via by Johannes Zinn,
  • We use identity generation with GenerationTyp.AUTO to support different DBMS (mssql and postgre) with a sequence generator for each Entity: {code:java} @SequenceGenerator(name = "SEQ_MY_CLASS", sequenceName = "SEQ_MY_CLASS") public class MyClass { private Integer id; .... @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_MY_CLASS") public Integer getId(){ ... } } {code} persistence.xml {code:xml} ... <property name="hibernate.hbm2ddl.auto" value="create" /> <property name="hibernate.default_schema" value="myschema" /> <property name="hibernate.default_catalog" value="mydatabase" /> <property name="hibernate.id.new_generator_mappings" value="true"/> ... {code} Hibernate generates the following SQL for creating the sequence, but MSSQL doesn't support providing catalog name on sequence creation. {code:sql} create sequence mycatalog.myschema.SEQ_MY_CLASS start with 1 increment by 50 {code} As result we receive the following Exception on wildfly startup: {code:java} 2016-06-09 13:13:30 INFO [ServerService Thread Pool -- 54] [] stdout: Hibernate: create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50 2016-06-09 13:13:30 WARN [ServerService Thread Pool -- 54] [] org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl: GenerationTarget encountered exception accepting command : Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50]: org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [create sequence mydatabase.myschema.SEQ_MY_CLASS start with 1 increment by 50] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:63) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:567) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:551) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.performMigration(SchemaMigratorImpl.java:289) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:137) at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:110) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:176) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:64) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:458) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:881) at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667) [wildfly-elytron-1.0.2.Final.jar:1.0.2.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45] at org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 'CREATE SEQUENCE' does not allow specifying the database name as a prefix to the object name. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:865) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:762) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159) at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:735) at org.jboss.jca.adapters.jdbc.WrappedStatement.execute(WrappedStatement.java:198) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:51) ... 19 more {code}
    via by Johannes Zinn,
    • com.microsoft.sqlserver.jdbc.SQLServerException: The object 'dot_containers' does not exist or is invalid for this operation. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)[sqljdbc42.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635)[sqljdbc42.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:865)[sqljdbc42.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:762)[sqljdbc42.jar:?] at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276)[sqljdbc42.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793)[sqljdbc42.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184)[sqljdbc42.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159)[sqljdbc42.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:735)[sqljdbc42.jar:?] at org.apache.tomcat.dbcp.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:290)[tomcat-dbcp.jar:8.0.18] at org.apache.tomcat.dbcp.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:290)[tomcat-dbcp.jar:8.0.18] at com.dotmarketing.common.db.DotConnect.executeStatement(DotConnect.java:222)[dotcms_3.5.1_3.5-8-g8506266.jar:?] at com.dotmarketing.startup.AbstractJDBCStartupTask.executeUpgrade(AbstractJDBCStartupTask.java:192)[dotcms_3.5.1_3.5-8-g8506266.jar:?] at com.dotmarketing.startup.StartupTasksExecutor.executeUpgrades(StartupTasksExecutor.java:268)[dotcms_3.5.1_3.5-8-g8506266.jar:?] at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:116)[dotcms_3.5.1_3.5-8-g8506266.jar:?] at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231)[catalina.jar:8.0.18]

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    82 more bugmates