Error creating SamlRegisteredService_AttributeNameFormats Table

59 views
Skip to first unread message

Maxwell, Gary

unread,
Jul 31, 2017, 4:58:45 PM7/31/17
to cas-...@apereo.org

We are upgrading from 5.0.1 to 5.1.2 and receive an error when the database is initialized. The following is set within the management.properties to perform the initialization:

 

cas.serviceRegistry.jpa.ddlAuto=create

cas.serviceRegistry.initFromJson=true

We are using mssql-jdbc version 6.2.0.jre8 and get the following error:

 

Hibernate: create table SamlRegisteredService_AttributeNameFormats (SamlRegisteredService_id bigint not null, value varchar(255), key varchar(255) not null, primary key (SamlRegisteredService_id, key))

2017-07-31 14:28:51,031 WARN [org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl] - <GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement>

org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL via JDBC Statement

 

Is SamlRegisteredService_AttributeNameFormats a new table?

Is this table required?

 

Thanks for any insight into this!!

 

Thanks Gary

 

.

Sai Mallela

unread,
Oct 4, 2017, 4:54:48 PM10/4/17
to CAS Community
Hello Gary,

Were you able to fix this issue? If so, can you advise on how to fix it.

Thanks,
Sai

Matthieu Marc

unread,
Jan 19, 2018, 2:16:17 AM1/19/18
to CAS Community
I had the same problem. The problem was the key column used a reserved keyword (key).

But, according to https://stackoverflow.com/questions/2889871/how-do-i-escape-reserved-words-used-as-column-names-mysql-create-table (martin smith answer), it is possible to used reserved keyword for column name with back tick escaping.

So using this configuration, it is working :

cas.serviceRegistry.jpa.properties.hibernate.globally_quoted_identifiers=true

It will configure the hibernate property globally_quoted_identifiers which will quoted all identifiers in the sql query (https://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/appendices/Configurations.html#_quoting_options)

 
    create table `SamlRegisteredService_AttributeNameFormats` (
       
`SamlRegisteredService_id` bigint not null,

       
`value` varchar(255),
       
`key` varchar(255) not null,

        primary key
(`SamlRegisteredService_id`, `key`)
   
) engine=InnoDB
Reply all
Reply to author
Forward
0 new messages