[keycloak-user] ClassNotFoundException when importing a resource server configuration JSON incl drools policy of 'photoz' example project
FREIMUELLER Christian
Christian.FREIMUELLER at frequentis.com
Tue Aug 30 02:41:27 EDT 2016
Dear all,
first of all - thanks for your effort for Keycloak - great product!
I'm trying to do a POC for the authorization API in Keycloak and therefore I downloaded from the project's website the Demo distribution and tried to follow the readme instructions on the "photoz" example.
The import of the realm was successful, but when I tried to load the resource server configuration JSON I received the following exception in the log file:
Caused by: java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64 from
[Module "org.drools:main" from local module loader @1476ceae (finder: local module finder @1b4febf3 (
roots: D:\dev\software\keycloak\keycloak-demo-2.1.0.Final\keycloak\modules,
D:\dev\software\keycloak\keycloak-demo-2.1.0.Final\keycloak\modules\system\layers\keycloak,
D:\dev\software\keycloak\keycloak-demo-2.1.0.Final\keycloak\modules\system\layers\base
))]
I was able to fix this issue by providing the following dependency entry in the drools module description for the commons-codec module at <KEYCLOAK_ROOT>\keycloak\modules\system\add-ons\keycloak\org\drools\main\module.xml
After this I could successfully import the "photoz-restful-api-authz-service.json" finally.
Could it be that this entry is also missing in the source code at https://github.com/keycloak/keycloak/tree/master/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/keycloak/org/drools/main/module.xml ?
<dependencies>
<module name="javax.api"/>
<module name="javax.inject.api"/>
<module name="javax.enterprise.api"/>
<module name="org.slf4j"/>
<module name="org.apache.commons.codec"/><!-- this one is missing -->
<module name="org.apache.commons.logging"/>
<module name="org.keycloak.keycloak-core"/>
<module name="org.keycloak.keycloak-common"/>
<module name="org.keycloak.keycloak-server-spi"/>
</dependencies>
I also found a related JIRA "KEYCLOAK-3279<https://issues.jboss.org/browse/KEYCLOAK-3279> Possible error with Drools policies when running on Windows" entry but this was closed without code fix, I think.
Can you verify this finding?
Thanks,
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160830/a898dd3c/attachment.html
More information about the keycloak-user
mailing list