Error creating SamlRegisteredService_AttributeNameFormats Table

瀏覽次數:59 次
跳到第一則未讀訊息

Maxwell, Gary

未讀,
2017年7月31日 下午4:58:452017/7/31
收件者: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

未讀,
2017年10月4日 下午4:54:482017/10/4
收件者: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

未讀,
2018年1月19日 凌晨2:16:172018/1/19
收件者: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
回覆所有人
回覆作者
轉寄
0 則新訊息