JDBC Storage Service exception on IDP 5.1.1

Diego Figueroa dfiguero at yorku.ca
Thu Aug 1 19:03:48 UTC 2024


Hi,

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:

https://shibboleth.atlassian.net/wiki/spaces/IDP5/pages/3199509576/StorageConfiguration
https://shibboleth.atlassian.net/wiki/spaces/IDPPLUGINS/pages/2989096970/JDBCStorageService

I installed the JDBC plugin, copied the MariaDB jar to the lib folder and in idp.properties I have:


    idp.session.StorageService = MyDataSource


While in the global.xml I have the following:


    <bean id="MyDataSource" class="org.apache.commons.dbcp2.BasicDataSource"
          p:driverClassName="org.mariadb.jdbc.Driver"
          p:url="jdbc:mysql://localhost:3306/shibboleth?autoReconnect=true"
          p:username="shibboleth"
          p:password="%{mysql.password}"
          p:maxIdle="5"
          p:testOnBorrow="true"
          p:testWhileIdle="true"
          p:testOnReturn="true"
          p:timeBetweenEvictionRunsMillis="120000"
          p:minEvictableIdleTimeMillis="120000"
          p:validationQuery="select 1"
          p:validationQueryTimeout="5" />

    <bean id="JDBCStorageService" parent="shibboleth.JDBCStorageService"
          p:cleanupInterval="%{idp.storage.cleanupInterval:PT10M}"
          p:dataSource-ref="MyDataSource" />


But every time I start Tomcat I get the error below:


2024-08-01 14:14:02,672 -  - ERROR [org.springframework.web.context.ContextLoader:294] - Context initialization failed
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
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:607)
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
      at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:595)
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
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:273)


I have also tried the following classes, but I still get the same type of conversion exception:


    org.apache.tomcat.dbcp.dbcp2.BasicDataSource
    org.apache.tomcat.jdbc.pool.DataSource


Any ideas where I should look at?


Thanks,

Diego

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20240801/80c947ad/attachment.htm>


More information about the users mailing list