Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to fix JNDI lookup for executor service #50

Open
jitendrakumarjha opened this issue Jul 6, 2021 · 0 comments
Open

Need to fix JNDI lookup for executor service #50

jitendrakumarjha opened this issue Jul 6, 2021 · 0 comments

Comments

@jitendrakumarjha
Copy link

org.keycloak.executors.DefaultExecutorsProviderFactory has logic :
protected void detectManaged() { String jndiName = MANAGED_EXECUTORS_SERVICE_JNDI_PREFIX + "default"; try { new InitialContext().lookup(jndiName); logger.debugf("We are in managed environment. Executor '%s' was available.", jndiName); managed = true; } catch (NamingException nnfe) { logger.debugf("We are not in managed environment. Executor '%s' was not available.", jndiName); managed = false; } }

means to work with managed executor 'java:jboss/ee/concurrency/executor/default' should be present in context.
So, I think you should first register 'java:jboss/ee/concurrency/executor/default' then "java:jboss/ee/concurrency/executor/default/storage-provider-threads" inside your DynamicJndiContextFactoryBuilder.java.

Also, the lookup method should throw 'NameNotFoundException' inside KeycloakInitialContext.java so as to fallback on default executor if the executor for given taskType not found.

@see
org.keycloak.executors.DefaultExecutorsProviderFactory:
protected ExecutorService getPoolManaged(String taskType, KeycloakSession session)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant