Ex: JDBC Storage Service exception on IDP 5.1.1
Diego Figueroa
dfiguero at yorku.ca
Thu Aug 1 19:42:54 UTC 2024
Thank you to both you and Scott, you fixed my issue.
Cheers!
Diego
________________________________
From: Paul B. Henson <henson at cpp.edu>
Sent: August 1, 2024 3:09 PM
To: Shib Users <users at shibboleth.net>
Cc: Diego Figueroa <dfiguero at yorku.ca>
Subject: Re: Ex: JDBC Storage Service exception on IDP 5.1.1
It's telling you:
> Failed to convert property value of type
> 'org.apache.commons.dbcp2.BasicDataSource' to required type
> 'org.opensaml.storage.StorageService' for property 'storageService';
You're setting idp.session.StorageService = MyDataSource; MyDataSource
is an org.apache.commons.dbcp2.BasicDataSource. It wants an
org.opensaml.storage.StorageService, which shibboleth.JDBCStorageService
is a child of.
I've never used the JDBC storage before, but I'm assuming you want:
idp.session.StorageService = JDBCStorageService
On Thu, Aug 01, 2024 at 07:03:48PM +0000, Diego Figueroa via users wrote:
> 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
>
> CAUTION: This email was not sent from a Cal Poly Pomona service. Exercise caution when clicking links or opening attachments. Please forward suspicious email to suspectemail at cpp.edu<mailto:suspectemail at cpp.edu>.
>
> --
> For Consortium Member technical support, see https://shibboleth.atlassian.net/wiki/x/ZYEpPw
> To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net
--
Paul B. Henson | Operating Systems and Network Analyst
henson at cpp.edu | California State Polytechnic University Pomona
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20240801/37d322ba/attachment.htm>
More information about the users
mailing list