Point to a new database instance and rerun the tests. It’s possible that 
service entries are not correctly loaded  because there have been made 
changes to the service model; that are incompatible with CAS 3.5 and 4.



You could possibly start fresh and then manually move the existing data 
over.



From: Adam Franco [mailto:[email protected]]
Sent: Monday, October 6, 2014 8:55 AM
To: [email protected]
Subject: [cas-user] Error configuring CAS 4.0.0 services registry with 
JpaServiceRegistryDaoImpl



Hello all,

We've been running CAS 3.x on the machine with no problems and are now 
trying to upgrade to CAS-4.0.0.

We've tried following the instructions at 
https://jasig.github.io/cas/4.0.0/installation/Service-Management.html to 
the letter, but cannot get the CAS to start as it always fails with an error 
like this:

Oct 06, 2014 11:06:06 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Oct 06, 2014 11:06:10 AM org.apache.catalina.core.ApplicationContext log
SEVERE: SafeContextLoaderListener:
The Spring ContextLoaderListener we wrap threw on contextInitialized.
But for our having caught this error, the web application context would not 
have initialized.
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'entityManagerFactory' defined in ServletContext resource 
[/WEB-INF/deployerConfigContext.xml]: Invocation of init method failed; 
nested exception is java.lang.IncompatibleClassChangeError: Implementing 
class
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)

 <http://pastebin.com/28qvrAqX> .... (more)




Below are our additions to our maven overlay. Is there some other critical 
piece that we are missing? The documentation doesn't seem to mention any 
additional requirements and the error seems like a pretty generic one that 
I'm having trouble using as a helpful search term.

Here is our pom.xml (additions in bold):

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd ">
    <modelVersion>4.0.0</modelVersion>
    <groupId>net.unicon</groupId>
    <artifactId>cas4-overlay</artifactId>
    <packaging>war</packaging>
    <version>1.0</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <warName>cas</warName>
                    <overlays>
                        <overlay>
                            <groupId>org.jasig.cas</groupId>
                            <artifactId>cas-server-webapp</artifactId>
                            <excludes>
                                <exclude>WEB-INF/cas.properties</exclude>
                                <exclude>WEB-INF/classes/log4j.xml</exclude>
                            </excludes>
                        </overlay>
                    </overlays>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

        </plugins>
        <finalName>cas</finalName>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.jasig.cas</groupId>
            <artifactId>cas-server-webapp</artifactId>
            <version>${cas.version}</version>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jasig.cas</groupId>
            <artifactId>cas-server-integration-restlet</artifactId>
            <version>${cas.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
                <groupId>org.jasig.cas</groupId>
                <artifactId>cas-server-support-ldap</artifactId>
                <version>${cas.version}</version>
        </dependency>
        <dependency>
                <groupId>commons-dbcp</groupId>
                <artifactId>commons-dbcp</artifactId>
                <version>${commons.dbcp.version}</version>
                <scope>runtime</scope>
        </dependency>
        <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>${hibernate.version}</version>
                <scope>compile</scope>
        </dependency>
        <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>${hibernate.entitymgmr.version}</version>
        </dependency>
        <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>${mysql.connector.version}</version>
        </dependency>
    </dependencies>

    <properties>
        <cas.version>4.0.0</cas.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <commons.dbcp.version>20030825.184428</commons.dbcp.version>
        <hibernate.version>4.3.5.Final</hibernate.version>
        <hibernate.entitymgmr.version>4.3.5.Final</hibernate.entitymgmr.version>
        <mysql.connector.version>3.1.11</mysql.connector.version>
    </properties>

    <repositories>
        <repository>
            <id>sonatype-releases</id>
            <url>http://oss.sonatype.org/content/repositories/releases/</url>
        </repository>
        <repository>
            <id>sonatype-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>
    </repositories>
</project>



and the deployerConfigContext.xml additions:


        <!-- Service Management Storage -->

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

        <util:list id="packagesToScan">
                <value>org.jasig.cas.services</value>
        </util:list>

        <bean id="entityManagerFactory"
                
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
                p:dataSource-ref="dataSource"
                p:jpaVendorAdapter-ref="jpaVendorAdapter"
                p:packagesToScan-ref="packagesToScan">
                <property name="jpaProperties">
                        <props>
                                <prop 
key="hibernate.dialect">${database.dialect}</prop>
                                <prop 
key="hibernate.hbm2ddl.auto">update</prop>
                                <prop 
key="hibernate.jdbc.batch_size">${database.batchSize}</prop>
                        </props>
               </property>
        </bean>

        <bean id="jpaVendorAdapter"
                
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
                p:generateDdl="true"
                p:showSql="true" />

        <bean id="serviceRegistryDao"
                 class="org.jasig.cas.services.JpaServiceRegistryDaoImpl" />

        <bean id="transactionManager"
                class="org.springframework.orm.jpa.JpaTransactionManager"
                p:entityManagerFactory-ref="entityManagerFactory" />

        <!-- 
           | Injects EntityManager/Factory instances into beans with
           | @PersistenceUnit and @PersistenceContext
         -->

        <bean 
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"
 
/>

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



And we added the following to our /etc/cas/cas.properties

#=========================================
# Service Storage
#=========================================
database.dialect=org.hibernate.dialect.MySQLDialect
database.batchSize=20
database.url=jdbc:mysql://host.domain.edu:3306/databasename?autoReconnect=true 
<http://host.domain.edu:3306/databasename?autoReconnect=true>
database.password=password
database.username=username

Thanks for any assistance you can provide!

Adam

--

Adam Franco
Senior Software Developer
Information Technology Services
Middlebury College
Middlebury, VT 05753
[email protected] <mailto:[email protected]>
802.443.2244


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

-- 
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