Hello Everyone,
First , i'd like to thank Stephan Arts for his answers to my previous
questions . I'm trying to create a clustered CAS deployment; therefore , all
the nodes in the CAS cluster need to access the ticket present in the
ticketRegistry . In order to achieve that objective , i' m trying to use a
JpaTicketRegistry as a shared ticket Registry betwwen the CAS cluster nodes
.Do you think it would be better to use EhCache or MemCached instead? I've come
across a weird (i think) problem on a single node test installation of a CAS
using JPATicketRegistry : the TGT are generated but they are not inserted in
the database , that is ,in the hibernate logs (that are written inside the
cas log ) , there are no "insert" , just "select" after a TGT is created . Am i
missing something ? i see no errors in the CAS logs .... I' m attaching my
ticketRegistry.xml file (without passwords) and some CAS logs ... i've found
that other people have come across the same problem in the past :
https://groups.google.com/forum/#!topic/jasig-cas-user/lk2cY4TejIg
that is , TGTs are created but are not inserted in the DB ...
Thanks for any help,
Sorry for my poor english ,
Damiano
--
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
2015-07-21 11:32:44,270 INFO
[com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - Audit trail
record BEGIN
=============================================================
WHO: audit:unknown
WHAT: supplied credentials: [pasco+password]
ACTION: AUTHENTICATION_SUCCESS
APPLICATION: CAS
WHEN: Tue Jul 21 11:32:44 CEST 2015
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================
2015-07-21 11:32:44,313 DEBUG [org.hibernate.internal.SessionImpl] - Opened
session at timestamp: 14374711642
2015-07-21 11:32:44,322 DEBUG
[org.hibernate.event.internal.AbstractSaveEventListener] - Generated
identifier: TGT-1-Oc2gXqsnYvjGCoyQCVazx9DDcHgghRMQ1NVfDMaAkfceENI1Nn-testhost,
using strategy: org.hibernate.id.Assigned
2015-07-21 11:32:44,343 INFO
[com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - Audit trail
record BEGIN
=============================================================
WHO: audit:unknown
WHAT: TGT-1-Oc2gXqsnYvjGCoyQCVazx9DDcHgghRMQ1NVfDMaAkfceENI1Nn-testhost
ACTION: TICKET_GRANTING_TICKET_CREATED
APPLICATION: CAS
WHEN: Tue Jul 21 11:32:44 CEST 2015
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================
2015-07-21 11:32:44,344 DEBUG [org.hibernate.internal.SessionImpl] - Opened
session at timestamp: 14374711643
2015-07-21 11:32:44,347 DEBUG [org.hibernate.loader.Loader] - Loading entity:
[org.jasig.cas.ticket.TicketGrantingTicketImpl#TGT-1-Oc2gXqsnYvjGCoyQCVazx9DDcHgghRMQ1NVfDMaAkfceENI1Nn-testhost]
2015-07-21 11:32:44,358 DEBUG
[org.hibernate.engine.jdbc.internal.LogicalConnectionImpl] - Obtaining JDBC
connection
2015-07-21 11:32:44,376 DEBUG
[org.hibernate.engine.jdbc.internal.LogicalConnectionImpl] - Obtained JDBC
connection
2015-07-21 11:32:44,390 DEBUG [org.hibernate.SQL] - select ticketgran0_.ID as
ID2_0_, ticketgran0_.NUMBER_OF_TIMES_USED as NUMBER2_2_0_,
ticketgran0_.CREATION_TIME as CREATION3_2_0_, ticketgran0_.EXPIRATION_POLICY as
EXPIRATION4_2_0_, ticketgran0_.LAST_TIME_USED as LAST5_2_0_,
ticketgran0_.PREVIOUS_LAST_TIME_USED as PREVIOUS6_2_0_,
ticketgran0_.ticketGrantingTicket_ID as ticketG11_2_0_,
ticketgran0_.AUTHENTICATION as AUTHENTI7_2_0_, ticketgran0_.EXPIRED as
EXPIRED2_0_, ticketgran0_.SERVICES_GRANTED_ACCESS_TO as SERVICES9_2_0_,
ticketgran0_.SUPPLEMENTAL_AUTHENTICATIONS as SUPPLEM10_2_0_ from
TICKETGRANTINGTICKET ticketgran0_ where ticketgran0_.ID=? for update
2015-07-21 11:32:44,473 DEBUG
[org.hibernate.engine.internal.StatefulPersistenceContext] - Initializing
non-lazy collections
2015-07-21 11:32:44,473 DEBUG [org.hibernate.loader.Loader] - Done entity load
2015-07-21 11:32:44,474 DEBUG
[org.hibernate.engine.jdbc.internal.LogicalConnectionImpl] - Releasing JDBC
connection
2015-07-21 11:32:44,474 DEBUG
[org.hibernate.engine.jdbc.internal.LogicalConnectionImpl] - Released JDBC
connection
2015-07-21 11:32:44,474 DEBUG
[org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler] - HHH000163:
Logical connection releasing its physical connection
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to Jasig under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Jasig licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at the following location:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<!--
NOTE:
This bean supports testing JPA components on multiple platforms.
In order to test a particular database platform, do the following:
1. Place a database.properties at the root of the cas-server-core module directory
2. Copy the database driver jar to cas-server-core/target/test-lib/jdbc-driver.jar
3. OPTIONAL: Set cas.jpa.concurrent system property to invoke concurrent tests
4. Execute test goal as usual
-->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="file:database.properties"
p:ignoreResourceNotFound="true"
p:ignoreUnresolvablePlaceholders="true">
<property name="properties">
<props>
<prop key="database.driverClass">com.mysql.jdbc.Driver</prop>
<prop key="database.user">username</prop>
<prop key="database.password">password</prop>
<prop key="database.url">jdbc:mysql://localhost:3306/cas_ticket?autoReconnect=true</prop>
<prop key="database.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="database.batchSize">1</prop>
</props>
</property>
</bean>
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource"
id="dataSource"
p:driverClass="com.mysql.jdbc.Driver"
p:username="username"
p:password="password"
p:url="jdbc:mysql://localhost:3306/cas_ticket?autoReconnect=true" />
<util:list id="packagesToScan">
<value>org.jasig.cas.services</value>
<value>org.jasig.cas.ticket</value>
</util:list>
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
id="factoryBean"
p:dataSource-ref="dataSource"
p:jpaVendorAdapter-ref="jpaVendorAdapter"
p:packagesToScan-ref="packagesToScan">
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.jdbc.batch_size">1</prop>
</props>
</property>
</bean>
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
id="jpaVendorAdapter"
p:generateDdl="true"
p:showSql="true" />
<bean class="org.jasig.cas.services.JpaServiceRegistryDaoImpl" id="dao" />
<bean class="org.springframework.orm.jpa.JpaTransactionManager" id="transactionManager"
p:entityManagerFactory-ref="factoryBean" />
<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry" />
<!--
Injects EntityManager/Factory instances into beans with
@PersistenceUnit and @PersistenceContext
-->
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to Jasig under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Jasig licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at the following location:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<!--
NOTE:
This bean supports testing JPA components on multiple platforms.
In order to test a particular database platform, do the following:
1. Place a database.properties at the root of the cas-server-core module
directory
2. Copy the database driver jar to
cas-server-core/target/test-lib/jdbc-driver.jar
3. OPTIONAL: Set cas.jpa.concurrent system property to invoke concurrent
tests
4. Execute test goal as usual
-->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="file:database.properties"
p:ignoreResourceNotFound="true"
p:ignoreUnresolvablePlaceholders="true">
<property name="properties">
<props>
<prop key="database.driverClass">com.mysql.jdbc.Driver</prop>
<prop key="database.user">username</prop>
<prop key="database.password">password</prop>
<prop
key="database.url">jdbc:mysql://localhost:3306/cas_ticket?autoReconnect=true</prop>
<prop
key="database.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="database.batchSize">1</prop>
</props>
</property>
</bean>
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource"
id="dataSource"
p:driverClass="com.mysql.jdbc.Driver"
p:username="username"
p:password="password"
p:url="jdbc:mysql://localhost:3306/cas_ticket?autoReconnect=true" />
<util:list id="packagesToScan">
<value>org.jasig.cas.services</value>
<value>org.jasig.cas.ticket</value>
</util:list>
<bean
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
id="factoryBean"
p:dataSource-ref="dataSource"
p:jpaVendorAdapter-ref="jpaVendorAdapter"
p:packagesToScan-ref="packagesToScan">
<property name="jpaProperties">
<props>
<prop
key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.jdbc.batch_size">1</prop>
</props>
</property>
</bean>
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
id="jpaVendorAdapter"
p:generateDdl="true"
p:showSql="true" />
<bean class="org.jasig.cas.services.JpaServiceRegistryDaoImpl" id="dao" />
<bean class="org.springframework.orm.jpa.JpaTransactionManager"
id="transactionManager"
p:entityManagerFactory-ref="factoryBean" />
<bean id="ticketRegistry"
class="org.jasig.cas.ticket.registry.JpaTicketRegistry" />
<!--
Injects EntityManager/Factory instances into beans with
@PersistenceUnit and @PersistenceContext
-->
<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
</beans>