[keycloak-dev] Why isn't the configuration/providers directory on my classpath when attempting to load a file?

Josh Cain josh.cain at redhat.com
Mon Jan 11 17:24:49 EST 2016


Hi all,

I'm in the process of writing an SPI for a federation provider that relies
on a third party library, and the library in turn uses a number of files.
I placed my SPI .jar, the third party library .jar, as well as its required
files in the keycloak-1.7.0.Final/standalone/configuration/providers
directory.  However, when the third party library attempts to locate its
required files on the classpath, it cannot find them.

Just for a sanity check, I've placed the files places like the sun/jdk/main
module on the AS, and observed that the files were picked up properly since
that particular folder was on the classpath.

Can anyone help me understand why those files are not being picked up as
classpath resources?  Does the configuration/providers directory not get
added to the classpath?

Just FYI, I poked through the library a bit, and it doesn't seem to be
doing anything strange.  It winds up doing the equivalent of:

Thread.currentThread().getContextClassLoader().getResourceAsStream(filePath);

Josh Cain | Software Applications Engineer
*Identity and Access Management*
*Red Hat*
+1 843-737-1735
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-dev/attachments/20160111/e7aeceeb/attachment.html 


More information about the keycloak-dev mailing list