[keycloak-user] Cannot create Drolls policy.

Pedro Igor Silva psilva at redhat.com
Thu Jul 7 07:32:09 EDT 2016


That error is pretty weird. In theory, I should be able to get it here too ...

The only difference that I can see between your environment and mine is the SO. Here, I'm using Linux. Will try to test using a windows box. I've also created https://issues.jboss.org/browse/KEYCLOAK-3279 to track this.

Please, watch that issue for updates.

Thanks.

----- Original Message -----
From: "Charlee Chitsuk" <charlee.ch at gmail.com>
To: keycloak-user at lists.jboss.org
Sent: Thursday, July 7, 2016 12:31:34 AM
Subject: Re: [keycloak-user] Cannot create Drolls policy.

Hi, 

Thank you very much for your guide. I've tried to follow your step, but there is no luck. The stacktrace show me as 

Caused by: java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64 from 
[Module "org.drools:main" from local module loader @33e5ccce (finder: local module finder @5a42bbf4 ( 

roots: C:\Java.Application\jboss\keycloak-2.0.0.Final\modules, 
C:\Java.Application\jboss\keycloak-2.0.0.Final\modules\system\layers\keycloak, 
C:\Java.Application\jboss\keycloak-2.0.0.Final\modules\system\layers\base 

))] 

Then I decided to copy the "commons-codec-1.10.jar" from " modules/system/layers/base/ org/apache/commons/codec/main " to "modules" directly. At the moment I can resolve that maven artifact for Drools. I'm not sure if it is a suitable way or not. Could you please help to advise how to put the dependency jars, e.g. the "commons-codec-1.10.jar", to the proper location? 

-- 
Best Regards, 

Charlee Ch 

2016-07-06 20:13 GMT+07:00 Pedro Igor Silva < psilva at redhat.com > : 


Hi, 

Could not reproduce that issue in my environment. Here is what I did: 

- Download standalone server distribution [1] 
- Download examples [2] 
- Extract both server and examples 
- Build examples 
- Run server 
- Import keycloak-examples-2.0.0.Final/authz/photoz/photoz-realm.json 
- Create a Drools Policy just like you did after selecting the "photoz-restful-api" client application. 

Could you send the full stack trace ? Am I'm missing any step in order to reproduce this ? 

Btw, I have also tested using the demo distribution. 

Regards. 
Pedro Igor 

[1] https://downloads.jboss.org/keycloak/2.0.0.Final/keycloak-2.0.0.Final.zip 
[2] https://downloads.jboss.org/keycloak/2.0.0.Final/keycloak-examples-2.0.0.Final.zip 

----- Original Message ----- 
From: "Charlee Chitsuk" < charlee.ch at gmail.com > 
To: keycloak-user at lists.jboss.org 
Sent: Wednesday, July 6, 2016 4:48:35 AM 
Subject: [keycloak-user] Cannot create Drolls policy. 

Hi, 

I'm using the keycloak version 2.0.0.Final with default standalone. I've build and install the maven artifact, the "org.keycloak:photoz-authz-policy:2.0.0.Final" and tried to create the Drools policy. as the following 

mavenArtifactGroupId = org.keycloak 
mavenArtifactId = photoz-authz-policy 
mavenArtifactVersion = 2.0.0.Final" 



When I click the "Resolve" button, the system shows me as "Error! An unexpected server error has occurred" 

The "standalone/log/server.log" also shows as 

[io.undertow.request] (default task-80) UT005023: Exception handling request to 
/auth/admin/realms/photoz/clients/001e0705-8bc6-47de-b408-dd07a5ebba9b/authz/resource-server/policy/drools/resolveModules: 
org.jboss.resteasy.spi.UnhandledException: java.lang.NoClassDefFoundError: 
org/apache/commons/codec/binary/Base64 
at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76) 
... 
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64 
at org.apache.http.impl.auth.BasicScheme.authenticate(BasicScheme.java:168) 

I can ensure that 

1. The "commons-codec-1.10.jar" is existed at "modules/system/layers/base/org/apache/commons/codec/main" 

2. The "org.keycloak:photoz-authz-policy:2.0.0.Final" is existed at my local repository at 
"some/drive/m2/repo/org/keycloak/photoz-authz-policy/2.0.0.Final/photoz-authz-policy-2.0.0.Final.jar". 

Could you please help to advise further? 

-- 
Best Regards, 

Charlee Ch 

_______________________________________________ 
keycloak-user mailing list 
keycloak-user at lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/keycloak-user 


_______________________________________________
keycloak-user mailing list
keycloak-user at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user


More information about the keycloak-user mailing list