I seem to have an issue with 7.0.0-RC9 when combining
cas-server-support-electrofence with cas-server-support-events-jpa.

Example build: here 
<https://casinit.herokuapp.com/ui?artifactId=cas&casVersion=7.0.0-RC9&commandlineShellSupported=true&dependencies=webapp-tomcat,support-electrofence,support-events-jpa,support-json-service-registry&deploymentType=executable&description=WAR%20overlay%20to%20use%20as%20a%20starting%20template%20for%20Apereo%20CAS%20deployments.&dockerSupported=true&githubActionsSupported=true&groupId=org.apereo.cas&helmSupported=false&herokuSupported=false&javaVersion=11&language=java&name=cas&nativeImageSupported=false&openRewriteSupported=true&packageName=org.apereo&packaging=war&puppeteerSupported=true&type=cas-overlay&version=1.0.0>
;

Example configuration:






*cas.events.jpa.driverClass=org.postgresql.Drivercas.events.jpa.dialect=org.hibernate.community.dialect.PostgreSQL95Dialectcas.events.jpa.url=jdbc:postgresql://localhost/cas7cas.events.jpa.user=CONFIGUREcas.events.jpa.password=CONFIGUREcas.service-registry.json.location=file:///etc/cas/config/services*

At specified json location, there needs to be a JSON service,
I used the example one from 
https://apereo.github.io/cas/development/services/JSON-Service-Management.html

When I log in with default user and password, I get thrown back to login 
page. In logs, I can see WARN messages:








*2023-11-28 09:44:29,314 WARN 
[org.apereo.cas.web.flow.resolver.impl.DefaultCasDelegatingWebflowEventResolver]
 
- <No qualifying bean of type 
'org.springframework.transaction.TransactionManager' available: expected 
single matching bean but found 2: 
ticketTransactionManager,transactionManagerEvents 
DefaultListableBeanFactory.java:resolveNamedBean:1310 
DefaultListableBeanFactory.java:resolveBean:484 
DefaultListableBeanFactory.java:getBean:3392023-11-28 09:44:29,314 WARN 
[org.apereo.cas.web.flow.resolver.impl.DefaultCasDelegatingWebflowEventResolver]
 
- <No qualifying bean of type 
'org.springframework.transaction.TransactionManager' available: expected 
single matching bean but found 2: 
ticketTransactionManager,transactionManagerEvents 
DefaultListableBeanFactory.java:resolveNamedBean:1310 
DefaultListableBeanFactory.java:resolveBean:484 
DefaultListableBeanFactory.java:getBean:339*

This seems to happen in the last line of 
BaseAuthenticationRequestRiskCalculator:getCasTicketGrantingTicketCreatedEventsFor().
When I remove electrofence from gradle file, I get the expected result, 
which is a "service not allowed" message.

It seemed to me like `@Transactional(readOnly = true)` annotations in 
JpaCasEventRepository (it's the only place I can
see this exact form of them) do not cooperate transactionManager parameter 
from @Transactional at the top of the class.
Hovewer, adding transactionManager to every @Transactional there doesn't 
fix the issue, only messages differ:








*2023-11-28 11:26:44,019 WARN 
[org.apereo.cas.web.flow.resolver.impl.DefaultCasDelegatingWebflowEventResolver]
 
- 
<org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl@21eae802 
is closed AbstractLogicalConnectionImplementor.java:errorIfClosed:37 
LogicalConnectionManagedImpl.java:getPhysicalConnection:142 
StatementPreparerImpl.java:connection:542023-11-28 11:26:44,019 WARN 
[org.apereo.cas.web.flow.resolver.impl.DefaultCasDelegatingWebflowEventResolver]
 
- 
<org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl@21eae802 
is closed AbstractLogicalConnectionImplementor.java:errorIfClosed:37 
LogicalConnectionManagedImpl.java:getPhysicalConnection:142 
StatementPreparerImpl.java:connection:54*

What am I doing wrong?

Kind regards,
Michał Nowakowski

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
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/6a4a70cc-80fd-4836-beb0-029dd70a2807n%40apereo.org.

Reply via email to