Unicon / shibboleth-idp-dockerized

A Shibboleth Identity Provider (IdP) base-image
Apache License 2.0
108 stars 54 forks source link

How would one add a jdbc db driver? #53

Closed lrhazi closed 6 years ago

lrhazi commented 6 years ago

Trying to figure out how to enable sql datasourcee in shibboleth and using this container. How would one add the jar file for the db driver? to what folder should it go?

Thank you so much.

lrhazi commented 6 years ago

Is it: /opt/shib-jetty-base/lib/ext/ ?

jtgasper3 commented 6 years ago

@lrhazi,

I'd COPY it into /opt/shibboleth-idp/webapp/WEB-INF/lib/

lrhazi commented 6 years ago

I just tried adding my jar to both locations:

COPY lib/sqlite-jdbc-3.23.1.jar /opt/shib-jetty-base/lib/ext/
COPY lib/sqlite-jdbc-3.23.1.jar /opt/shibboleth-idp/webapp/WEB-INF/lib/

But I still get:

May 31, 2018 2:28:51 PM com.mchange.v2.c3p0.DriverManagerDataSource ensureDriverLoaded
WARNING: Could not load driverClass jdbc:sqlite
java.lang.ClassNotFoundException: jdbc:sqlite

Do I also need to add some kind of rebuilding of jetty step? I don't know much about jdbc, so am kind of just guessing :)

lrhazi commented 6 years ago

It seems the correct way to reference the driver is org.sqlite.JDBC But now am getting:

May 31, 2018 2:53:38 PM com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask run
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@f273027 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (36). Last acquisition attempt exception: 
java.sql.SQLException: No suitable driver
lrhazi commented 6 years ago

Looks like my jdbcURL was also wrong... now it seems to at least start without any complaints!! Thanks a lot.

<DataConnector id="sqliteConnector" xsi:type="RelationalDatabase">
   <ApplicationManagedConnection
         jdbcDriver="org.sqlite.JDBC" jdbcURL="jdbc:sqlite:/tmp/mydb" poolAcquireRetryAttempts="1"/></DataConnector>