Thanks Sam.

I thought the dataSource bean was needed based on the statement in the 
documentation “The configuration assumes a dataSource bean is defined in the 
context.”

I have tried what you suggested and I am still getting the same error.

Thanks,
Aaron

From: [email protected] [mailto:[email protected]]
Sent: Wednesday, November 09, 2016 12:33 PM
To: jasig-cas-user <[email protected]>
Cc: [email protected]; Aaron Eidt <[email protected]>
Subject: Re: [cas-user] Problem deploying CAS 4.2.2 with MySQL Service Registry

Hi Aaron,

I struggled for a while with this as well. In the end I added the 
mysql-connector dependency you already found (I don't have the hibernate or 
mchange ones), and also:
<dependency>
    <groupId>org.jasig.cas</groupId>
    <artifactId>cas-server-support-jpa-service-registry</artifactId>
    <version>${cas.version}</version>
</dependency>

In deployerConfigContext.xml I have a line like this

    <alias name="jpaServiceRegistryDao" alias="serviceRegistryDao" />

but not your datasource bean.

The in the cas.properties file (which'll need to be somewhere on the classpath) 
you can configure the database with lines like the following:

# JPA Service Registry Database Configuration
svcreg.database.ddl.auto=create-drop
svcreg.database.dialect=org.hibernate.dialect.OracleDialect|MySQLInnoDBDialect|HSQLDialect
svcreg.database.hibernate.batchSize=10
svcreg.database.driverClass=org.hsqldb.jdbcDriver
svcreg.database.url=jdbc:hsqldb:mem:cas-ticket-registry
svcreg.database.user=sa
svcreg.database.password=
svcreg.database.pool.minSize=6
svcreg.database.pool.maxSize=18
svcreg.database.pool.maxWait=10000
svcreg.database.pool.maxIdleTime=120
svcreg.database.pool.acquireIncrement=6
svcreg.database.pool.idleConnectionTestPeriod=30
svcreg.database.pool.connectionHealthQuery=select 1
svcreg.database.pool.acquireRetryAttempts=5
svcreg.database.pool.acquireRetryDelay=2000
svcreg.database.pool.connectionHealthQuery=select 1

It's documented here: 
https://apereo.github.io/cas/4.2.x/installation/JPA-Service-Management.html

All the best,

Sam Jones.


On Wednesday, 9 November 2016 17:07:36 UTC, Aaron Eidt wrote:
I wondered if someone can help us with a CAS 4.2.2 deployment problem.

For the past 2 weeks, we tried to deploy CAS 4.2.2 with mysql for
serviceRegistry without success. It failed with "Unable to acquire JDBC
Connection" error.

We searched the Unicon github. Only found a simple samle using json.
There was not much info out there in the CAS-user or CAS-community either.

Here's our config

deployercontext.xml

  <bean        id="dataSource"
        class="com.mchange.v2.c3p0.ComboPooledDataSource"
p:driverClassName="org.hibernate.dialect.MySQL5InnoDBDialect"
p:url="jdbc:mysql://localhost:3306/serviceregistry?autoReconnect=true"
p:password="...."
        p:username="webxxxx" />

The pom.xml

   <dependency>
    <groupId>com.mchange</groupId>
    <artifactId>c3p0</artifactId>
    <version>0.9.2.1</version>
  </dependency>


<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.1.0.Final</version>
        </dependency>


  <dependency>
    <groupId>org.hibernate</groupId>
   <artifactId>hibernate-entitymanager</artifactId>
    <version>5.1.0.Final</version>
</dependency>


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

Error in the tomcat log

Caused by:
org.springframework.transaction.CannotCreateTransactionException: Could
not open JPA EntityManager for transaction; nested exception is
javax.persistence.PersistenceException:
org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC
Connection


Are we missing anything in pom.xml?

Any help is appreciated!

Thanks in advance!


--
- 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 [email protected]<javascript:>.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/DM5PR11MB1289AEADCB84AC7AFC8D5B01F2B90%40DM5PR11MB1289.namprd11.prod.outlook.com<https://groups.google.com/a/apereo.org/d/msgid/cas-user/DM5PR11MB1289AEADCB84AC7AFC8D5B01F2B90%40DM5PR11MB1289.namprd11.prod.outlook.com?utm_medium=email&utm_source=footer>.

-- 
- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/DM5PR11MB1289DDC6C9155B97175DD011F2B90%40DM5PR11MB1289.namprd11.prod.outlook.com.

Reply via email to