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 <[email protected]> :: UH Information Technology Services
minutas cantorum, minutas balorum, minutas carboratum desendus pantorum

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to