CAS PostgreSql Connection Problem

322 views
Skip to first unread message

Aghil krishna

unread,
Apr 4, 2018, 9:17:21 AM4/4/18
to CAS Community
Hi All,

I'm trying to integrate CAS server with my exiting client projects. I'm facing database connection timeout issue.

CAS Version : 4.2.1
Database : PostgreSql



In cas.properties, 



# == Basic database connection pool configuration ==
database.driverClass=org.postgresql.Driver
database.url=jdbc:postgresql://IP-ADDRESS:5432/DBNAME
database.user=username
database.password=password
database.pool.minSize=6
database.pool.maxSize=18

# Maximum amount of time to wait in ms for a connection to become
# available when the pool is exhausted
database.pool.maxWait=10000

# Amount of time in seconds after which idle connections
# in excess of minimum size are pruned.
database.pool.maxIdleTime=120

# Number of connections to obtain on pool exhaustion condition.
# The maximum pool size is always respected when acquiring
# new connections.
database.pool.acquireIncrement=6

# == Connection testing settings ==

# Period in s at which a health query will be issued on idle
# connections to determine connection liveliness.
database.pool.idleConnectionTestPeriod=30

# Query executed periodically to test health
database.pool.connectionHealthQuery=select 1

# == Database recovery settings ==

# Number of times to retry acquiring a _new_ connection
# when an error is encountered during acquisition.
database.pool.acquireRetryAttempts=5

# Amount of time in ms to wait between successive aquire retry attempts.
database.pool.acquireRetryDelay=2000



# == PDS User record fetch query == #
cas.jdbc.authn.query.sql=select * from user where username = ?




After entering login credential from login page, I'm getting the below error.

2018-04-04 17:35:58,718 ERROR [org.jasig.cas.authentication.PolicyBasedAuthenticationManager] - <CustomDatabaseAuthenticationHandler: SQL exception while executing query for testusername  (Details: Could not get JDBC Connection; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.)>

 
Please update me what has to be done to resolve this. 

Note : The same cas server setup is working with mysql database but not in postgresql .

Regards,
Aghil

Uxío Prego

unread,
Apr 4, 2018, 11:30:15 AM4/4/18
to CAS Community
Can you confirm psql connectivity between the data base and the Java application server (i.e. CAS)?

Uxío Prego

             

Madiva Soluciones
CL / SERRANO GALVACHE 56
BLOQUE ABEDUL PLANTA 4
28033 MADRID

+34 917 56 84 94
www.madiva.com
www.bbva.com

The activity of email inboxes can be systematically tracked by colleagues, business partners and third parties. Turn off automatic loading of images to hamper it.

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/b5cb2526-b354-42d3-ac8b-eb634af4ddc3%40apereo.org.

Message has been deleted
Message has been deleted

Uxío Prego

unread,
Apr 6, 2018, 5:25:41 AM4/6/18
to CAS Community
I don't have CAS 4 flight hours, but I would make sure you don't need to define 'database.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect'. As long as it is causing issues, I would also consider using 'database.hibernate.show.sql=true' and look into your logging configuration and lower org.hibernate level to DEBUG if you find it.

Uxío Prego

             

Madiva Soluciones
CL / SERRANO GALVACHE 56
BLOQUE ABEDUL PLANTA 4
28033 MADRID

+34 917 56 84 94
www.madiva.com
www.bbva.com

The activity of email inboxes can be systematically tracked by colleagues, business partners and third parties. Turn off automatic loading of images to hamper it.

2018-04-06 7:23 GMT+00:00 Aghil krishna <aghilk...@gmail.com>:

same database is configured in my spring boot project and its working fine. But when i use in the same in cas server , it throws connection timeout

Regards,
Aghil
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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+unsubscribe@apereo.org.

Uxío Prego

unread,
Apr 6, 2018, 5:28:02 AM4/6/18
to CAS Community
I don't know.

In Maven environments I would expect the declaration of a postgresql artifact from the org.postgresql group ID.

Uxío Prego

             

Madiva Soluciones
CL / SERRANO GALVACHE 56
BLOQUE ABEDUL PLANTA 4
28033 MADRID

+34 917 56 84 94
www.madiva.com
www.bbva.com

The activity of email inboxes can be systematically tracked by colleagues, business partners and third parties. Turn off automatic loading of images to hamper it.

2018-04-06 6:12 GMT+00:00 Aghil krishna <aghilk...@gmail.com>:
Hi,

I checked the connectivity through my client server (Spring boot) and its working fine. Is there any gradle config require for the postgresql ? Because I haven't mentioned any gradle config for that.

Regards,
Aghil T U


On Wednesday, April 4, 2018 at 9:00:15 PM UTC+5:30, Uxío Prego wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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+unsubscribe@apereo.org.

Aghil krishna

unread,
Apr 10, 2018, 3:25:34 AM4/10/18
to CAS Community
The issue got resolved once I added the postresql library into cas server lib folder.
Reply all
Reply to author
Forward
0 new messages