[cas-user] config error, documentation error, or bug?

23 views
Skip to first unread message

Baron Fujimoto

unread,
Mar 19, 2014, 11:02:29 PM3/19/14
to cas-...@lists.jasig.org
I'm assuming config error, but am at a loss as to what specifically.

The documentation notes on the availability of Services Management
Application Database says, "If the Services Management Application
database happens to be unavailable you will still be able to perform
service authorization. CAS maintains an in-memory collection of services
that is periodically refreshed from the database. If the database is
down, the periodic refresh process will fail. But the in-memory data will
continue to be available to support service authorization."

<https://wiki.jasig.org/display/CASUM/Configuring#Configuring-NotesontheavailabilityofServicesManagementApplicationDatabase>

However, we have reproducibly determined that when our services managment
database is unavailable, users see following error:

===
CAS is Unavailable

There was an error trying to complete your request. Please notify your support desk or try again.
===

and I find this error in Tomcat's catalina.out logfile:

===
2014-03-19 09:50:21,987 ERROR [org.quartz.core.ErrorLogger] - <Job (DEFAULT.serviceRegistryReloaderJobDetail threw an exception.>
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'reload' on target class [class com.sun.proxy.$Proxy27] failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Cannot open connection; nested exception is org.hibernate.exception.JDBCConnectionException: Cannot open connection]
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'reload' on target class [class com.sun.proxy.$Proxy27] failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Cannot open connection; nested exception is org.hibernate.exception.JDBCConnectionException: Cannot open connection
[...]
===

I believe this is the relevant configuration from
deployerConfigContext.xml:

<!--
Define the Service Registry
-->
<bean id="serviceRegistryDao" class="org.jasig.cas.services.JpaServiceRegistryDaoImpl"
p:entityManagerFactory-ref="entityManagerFactory" />

<!-- Persistent Service Registry: mysql -->
<!-- This is the EntityManagerFactory configuration for Hibernate -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="generateDdl" value="true"/>
<property name="showSql" value="true" />
</bean>
</property>
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">${database.hibernate.dialect}</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
</bean>

<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>

<tx:annotation-driven transaction-manager="transactionManager"/>

<bean
id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
p:driverClassName="com.mysql.jdbc.Driver"
p:url="${service.registry.url}"
p:username="${service.registry.username}"
p:password="${service.registry.password}" />
===

${database.hibernate.dialect} is defined in cas.properties as:
database.hibernate.dialect=org.hibernate.dialect.MySQLDialect

and pom.xml contains:

===
<!-- Dependencies for database classes -->
<!--
Apache Commons DBCP
-->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
<scope>runtime</scope>
</dependency>

<!--
Hibernate Entities
-->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.5.0-CR-2</version>
</dependency>

<!--
MySQL Connector
-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.20</version>
</dependency>

<!-- End Dependencies for database jars -->
===

--
Baron Fujimoto <ba...@hawaii.edu> :: UH Information Technology Services
minutas cantorum, minutas balorum, minutas carboratum desendus pantorum

--
You are currently subscribed to cas-...@lists.jasig.org as: jasig-cas-user...@googlegroups.com
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Andrew Morgan

unread,
Mar 20, 2014, 2:16:06 AM3/20/14
to cas-...@lists.jasig.org
This is the same behavior I've seen in my own testing. When the MySQL
database backend is unavailable, CAS is also unavailable.

Is there someone out there for whom CAS continues working when the
database is unavailable?

Andy
> You are currently subscribed to cas-...@lists.jasig.org as: mor...@orst.edu

Jérôme LELEU

unread,
Mar 20, 2014, 10:30:37 AM3/20/14
to cas-...@lists.jasig.org
Hi,

Which CAS server version are we talking about?
Best regards,
Jérôme




--
You are currently subscribed to cas-...@lists.jasig.org as: lel...@gmail.com

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Andrew Morgan

unread,
Mar 20, 2014, 12:13:37 PM3/20/14
to cas-...@lists.jasig.org
I think I last tested this behavior with 3.4.12. I'm running 3.5.2 right
now.

Andy

On Thu, 20 Mar 2014, J?r?me LELEU wrote:

> Hi,
>
> Which CAS server version are we talking about?
> Best regards,
> J?r?me

Baron Fujimoto

unread,
Mar 20, 2014, 4:13:08 PM3/20/14
to cas-...@lists.jasig.org
3.4.11 here, also using MySQL.

-baron

On Thu, Mar 20, 2014 at 03:30:37PM +0100, J?r?me LELEU wrote:
>
>Which CAS server version are we talking about?
>
>2014-03-20 7:16 GMT+01:00 Andrew Morgan <mor...@orst.edu>:
>
>> This is the same behavior I've seen in my own testing. When the MySQL
>> database backend is unavailable, CAS is also unavailable.
>>
>> Is there someone out there for whom CAS continues working when the
>> database is unavailable?
>>
>>> at org.quartz.simpl.SimpleThreadPool$WorkerThread.
>>> run(SimpleThreadPool.java:525)
>>> Caused by: org.springframework.scheduling.quartz.

Jérôme LELEU

unread,
Mar 21, 2014, 10:59:12 AM3/21/14
to cas-...@lists.jasig.org
Is CAS 4.0-RC3 affected?
Thanks,
Jérôme



You are currently subscribed to cas-...@lists.jasig.org as: lel...@gmail.com

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Baron Fujimoto

unread,
Mar 21, 2014, 8:46:41 PM3/21/14
to cas-...@lists.jasig.org
Unknown. Unfortunately, I won't have an opportunity to test or deploy that
version in the short to medium term.

-baron

On Fri, Mar 21, 2014 at 03:59:12PM +0100, J?r?me LELEU wrote:
>Is CAS 4.0-RC3 affected?
>Thanks,
>J?r?me

Jérôme LELEU

unread,
Mar 23, 2014, 4:45:37 AM3/23/14
to cas-...@lists.jasig.org
Hi,

OK. I'll make a test next week on the 4.0-RC4-SNAPSHOT... and keep you posted...
Best regards,
Jérôme



You are currently subscribed to cas-...@lists.jasig.org as: lel...@gmail.com

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Reply all
Reply to author
Forward
0 new messages