<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
Hi,</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
I am trying to setup a storage service using MySQL with JDBC on Shibboleth 5.1.1 and I tried following the instructions on these two places:</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<a href="https://shibboleth.atlassian.net/wiki/spaces/IDP5/pages/3199509576/StorageConfiguration" id="LPlnk348199" class="OWAAutoLink">https://shibboleth.atlassian.net/wiki/spaces/IDP5/pages/3199509576/StorageConfiguration</a></div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<a href="https://shibboleth.atlassian.net/wiki/spaces/IDPPLUGINS/pages/2989096970/JDBCStorageService" id="LPlnk168815" class="OWAAutoLink">https://shibboleth.atlassian.net/wiki/spaces/IDPPLUGINS/pages/2989096970/JDBCStorageService</a></div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
I installed the JDBC plugin, copied the MariaDB jar to the lib folder and in idp.properties I have:</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
idp.session.StorageService = MyDataSource</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
While in the global.xml I have the following:</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<bean id="MyDataSource" class="org.apache.commons.dbcp2.BasicDataSource"</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:driverClassName="org.mariadb.jdbc.Driver"</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:url="jdbc:mysql://localhost:3306/shibboleth?autoReconnect=true"</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:username="shibboleth"</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:password="%{mysql.password}"</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:maxIdle="5"</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:testOnBorrow="true"</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:testWhileIdle="true"</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:testOnReturn="true"</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:timeBetweenEvictionRunsMillis="120000"</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:minEvictableIdleTimeMillis="120000"</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:validationQuery="select 1"</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:validationQueryTimeout="5" /></div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<bean id="JDBCStorageService" parent="shibboleth.JDBCStorageService"</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:cleanupInterval="%{idp.storage.cleanupInterval:PT10M}"</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
p:dataSource-ref="MyDataSource" /></div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
But every time I start Tomcat I get the error below:</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
2024-08-01 14:14:02,672 - - ERROR [org.springframework.web.context.ContextLoader:294] - Context initialization failed</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shibboleth.SessionManager' defined in class path resource [net/shibboleth/idp/conf/session-manager-system.xml]: Failed to convert property value of type 'org.apache.commons.dbcp2.BasicDataSource'
to required type 'org.opensaml.storage.StorageService' for property 'storageService'; Cannot convert value of type 'org.apache.commons.dbcp2.BasicDataSource' to required type 'org.opensaml.storage.StorageService' for property 'storageService': no matching
editors or conversion strategy found</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:607)</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.apache.commons.dbcp2.BasicDataSource' to required type 'org.opensaml.storage.StorageService' for property 'storageService'; Cannot convert value
of type 'org.apache.commons.dbcp2.BasicDataSource' to required type 'org.opensaml.storage.StorageService' for property 'storageService': no matching editors or conversion strategy found</div>
<div style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:595)</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
Caused by: java.lang.IllegalStateException: Cannot convert value of type 'org.apache.commons.dbcp2.BasicDataSource' to required type 'org.opensaml.storage.StorageService' for property 'storageService': no matching editors or conversion strategy found</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:273)</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
I have also tried the following classes, but I still get the same type of conversion exception:</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
org.apache.tomcat.dbcp.dbcp2.BasicDataSource</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
org.apache.tomcat.jdbc.pool.DataSource</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
Any ideas where I should look at?</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 11pt; color: rgb(0, 0, 0);">
Diego</div>
<div id="Signature" style="color: inherit;">
<div style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif;" dir="ltr" id="divtagdefaultwrapper">
<br>
</div>
</div>
</body>
</html>