JPA Service Registry Persistence (CAS 5.0.6)

503 views
Skip to first unread message

Iain Workman

unread,
Jun 15, 2017, 5:32:30 PM6/15/17
to CAS Community
I am currently trying to configure the service registry for a CAS server (Maven Overlay, v5.0.6) using mysql as the persistent backend as per the information here. The intention is to also have a cas-management application for the creation/updating etc. of the services. 

My current contents of pom.xml has the required dependency:

<dependency>
 
<groupId>org.apereo.cas</groupId>
 
<artifactId>cas-server-support-jpa-service-registry</artifactId>
 
<version>${cas.version}</version>
</dependency>

with the following settings in etc/cas/cas.properties

# Service Registry Settings
###########################
cas
.serviceRegistry.jpa.healthQuery: SELECT 1 FROM INFORMATION_SCHEMA.TABLES
cas
.serviceRegistry.jpa.driverClass: com.mysql.cj.jdbc.Driver
cas
.serviceRegistry.jpa.url: jdbc:mysql://localhost:3306/cas_services
cas
.serviceRegistry.jpa.dialect: org.hibernate.dialect.MySQL5Dialect
cas
.serviceRegistry.jpa.user: ***********
cas
.serviceRegistry.jpa.password:**********

This seems to work insofar as the tables are initialized and populated with the standard default entries. Unfortunately when the cas server process is shut down it drops all the tables which contain the service registry data. This doesn't seem particularly persistent to me and, if a cas-management application is running as the same time then it will crash when it finds its data tables no longer exist. The server outputs the following on exit:

alter table RegisteredServiceImpl_Props drop foreign key FK1xan7uamsa94y2451jgksjkj4
Hibernate: alter table RegisteredServiceImpl_Props drop foreign key FK5ghaknoplphay7reury7n3vcm
Hibernate: drop table if exists hibernate_sequence
Hibernate: drop table if exists RegexRegisteredService
Hibernate: drop table if exists RegexRegisteredServiceProperty
Hibernate: drop table if exists RegisteredServiceImpl_Props

Is there some element to the persistent storage of services which I am not understanding, or is there a configuration mistake which I have made?

Thanks


Bergner, Arnold

unread,
Jun 16, 2017, 7:40:13 AM6/16/17
to cas-...@apereo.org

Hi,

 

I‘ve stumbled over this as well as a few others.

 

It’s this property:

11 # cas.serviceRegistry.jpa.ddlAuto=create-drop

https://apereo.github.io/cas/5.0.x/installation/Configuration-Properties.html#database-service-registry

 

 

Says it’ll create the tables everytime CAS starts and drops when shutting down.

 

You could for example set it to „create“, start once, then leave blank for further startups. Or take a look at the code for further options :/

 

Cheers

Arnold

--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/6db951e8-daff-4e76-bb18-f2a40e633334%40apereo.org.

Bergner, Arnold

unread,
Jun 16, 2017, 7:40:14 AM6/16/17
to cas-...@apereo.org

 

Von: Bergner, Arnold
Gesendet: Freitag, 16. Juni 2017 09:56
An: 'cas-...@apereo.org' <cas-...@apereo.org>
Betreff: [cas-user] JPA Service Registry Persistence (CAS 5.0.6)

 

Hi,

 

I‘ve stumbled over this as well as a few others.

 

It’s this property:

11 # cas.serviceRegistry.jpa.ddlAuto=create-drop

https://apereo.github.io/cas/5.0.x/installation/Configuration-Properties.html#database-service-registry

 

 

Says it’ll create the tables everytime CAS starts and drops when shutting down.

 

You could for example set it to „create“, start once, then leave blank for further startups. Or take a look at the code for further options :/

 

Cheers

Arnold

 

Von: 'Iain Workman' via CAS Community [mailto:cas-...@apereo.org]
Gesendet: Donnerstag, 15. Juni 2017 23:33
An: CAS Community <cas-...@apereo.org>
Betreff: [cas-user] JPA Service Registry Persistence (CAS 5.0.6)

 

I am currently trying to configure the service registry for a CAS server (Maven Overlay, v5.0.6) using mysql as the persistent backend as per the information here. The intention is to also have a cas-management application for the creation/updating etc. of the services. 

--

Iain Workman

unread,
Jun 16, 2017, 10:12:20 AM6/16/17
to CAS Community, arnold....@hrz.tu-darmstadt.de
Thank you for the response. This solved my issue. 

Uxío Prego

unread,
Jun 17, 2017, 10:24:46 AM6/17/17
to CAS Community
There are some or at least one configuration keys named $BLAH.jpa.ddlAuto or
$BLAH.jpa.ddl.auto that if are set to (or defaulting to) 'create-drop' might be
causing those table dropping.
Reply all
Reply to author
Forward
0 new messages