JPA ticket and service register on postgres

80 views
Skip to first unread message

Filipa Deus

unread,
Oct 17, 2018, 5:24:43 AM10/17/18
to CAS Community

Hi!

I am setting up cas ticket registry to use my PostgresSQL server and these are my configurations on cas.properties.
cas.ticket.registry.jpa.ticketLockType=NONE
cas.ticket.registry.jpa.jpaLockingTimeout=3600
cas.ticket.registry.jpa.url=jdbc:postgresql://localhost:5432/cas-sessions
cas.ticket.registry.jpa.driverClass=org.postgresql.Driver
cas.ticket.registry.jpa.idleTimeout=5000
cas.ticket.registry.jpa.ddlAuto=create

When I try to login with my credentials I get this error:
org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:231)
	at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:68)
	at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517)
	... 152 more
Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into TICKETGRANTINGTICKET (NUMBER_OF_TIMES_USED, CREATION_TIME, EXPIRATION_POLICY, EXPIRED, LAST_TIME_USED, PREVIOUS_LAST_TIME_USED, AUTHENTICATION, DESCENDANT_TICKETS, PROXIED_BY, PROXY_GRANTING_TICKETS, SERVICES_GRANTED_ACCESS_TO, ticketGrantingTicket_ID, TYPE, ID) values (0, '2018-10-17 10:08:07.934+01', ?, 'FALSE', '2018-10-17 10:08:07.934+01', NULL, ?, ?, NULL, ?, ?, NULL, 'TGT', 'TGT-1-dARCtSSQzHO2xaoVWIuEEyuwzwBYna1uG4Pf-7k738qT2LZkUdBD9hkzJi3NmQotwPEL-BR-FILIPA01') was aborted: ERROR: relation "ticketgrantingticket" does not exist
  Position: 13  Call getNextException to see other errors in the batch.
	at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:148)
	at org.postgresql.core.ResultHandlerDelegate.handleError(ResultHandlerDelegate.java:50)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2179)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:479)
	at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:835)
	at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1556)
	at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
	at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:118)
	... 169 more
Caused by: org.postgresql.util.PSQLException: ERROR: relation "ticketgrantingticket" does not exist

It seems that the ticket registry schema is not being created althought I have the setting cas.ticket.registry.jpa.ddlAuto=create. 

Am I missing a configuration? I have no tables on my cas-sessions database. Shouldn't they get created automatically?

Thank you.

Pedro Rosas

unread,
Oct 19, 2018, 7:05:40 AM10/19/18
to CAS Community
Hello,

Yes, the schema should get automatically created provided that the property is set to cas.ticket.registry.jpa.ddlAuto=create
By looking at your log, it might be that the dialect you're using is wrong.

Try using some different dialects to see if it helps.
For example:

cas.ticket.registry.jpa.dialect=org.hibernate.dialect.PostgreSQL94Dialect


Best Regards,
  Pedro Rosas
Reply all
Reply to author
Forward
0 new messages