Hello,
I am trying to configure jpa ticket registry. Firstly I added the following
dependency :
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-jpa-ticket-registry</artifactId>
<version>${cas.version}</version>
</dependency>
Then I checked the documentation at
https://apereo.github.io/cas/5.0.x/installation/JPA-Ticket-Registry.html.
Since I don't want to use the pooled connection and prefer a predefined
jndi datasource, the configuration parameters seem to be useless. I need to
define the datasource. First I tried to declare an alias in
deployerConfigContext.xml :
<alias name="myDS" alias="dataSourceTicket" />
But I get the following error at startup :
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'ticketEntityManagerFactory' defined in class path resource [
org/apereo/cas/config/JpaTicketRegistryConfiguration.class]: Bean
instantiation via factory method failed; nested exception is org.
springframework.beans.BeanInstantiationException: Failed to instantiate [org
.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory
method 'ticketEntityManagerFactory' threw exception; nested exception is
java.lang.ClassCastException: org.springframework.jndi.
JndiObjectFactoryBean$$EnhancerBySpringCGLIB$$ceb3620f cannot be cast to
javax.sql.DataSource
Then tried another solution :
<bean id="dataSourceTicket" class="com.zaxxer.hikari.HikariDataSource"
p:dataSource-ref="myDS"/>
and get the following error :
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method init xxx.myDao required a single bean, but 2 were
found:
- dataSourceTicket: defined in class path resource [
deployerConfigContext.xml]
- myDS: defined in class path resource [myApplicationContext.xml]
Action:
Consider marking one of the beans as @Primary, updating the consumer to
accept multiple beans, or using @Qualifier to identify the bean that should
be consumed
What do you suggest me, how I can solve this issue ?
Thanks.
--
- 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/348f904a-9d14-4dfc-8497-5c5ca1274efd%40apereo.org.