# Uncaught server error: java.lang.NoClassDefFoundError when implementing Authenticator

**URL:** <https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-when-implementing-authenticator/3974>\
**Category:** Extending the server\
**Created:** [July 27, 2020, 1:01pm UTC](https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-when-implementing-authenticator/3974 "2020-07-27T13:01:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ced](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@ced](https://forum.keycloak.org/u/ced)\
**Post date:** [July 27, 2020, 1:01pm UTC](https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-when-implementing-authenticator/3974/1 "2020-07-27T13:01:11Z")

</div>

Hello

I just recently tackled a project of extending the “forgot password” feature in keycloak and have been at a standstill for some days now.

I’m implementing the Authenticator and AuthenticatorFactory and getting the following error when using the token class:  
08:32:56,942 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-1) Uncaught server error: java.lang.NoClassDefFoundError: org/keycloak/authentication/actiontoken/resetcred/ResetCredentialsActionToken

This error points me in a missing dependency, so i’ve added the following to my pom.xml:  
keycloak-core  
keycloak-common  
keycloak-services  
keycloak-adapter-core  
keycloak-server-spi  
keycloak-adapter-spi  
keycloak-server-spi-private  
eycloak-admin-client

None of the above worked, still getting the same error.

Everything seems to be related to the following line in my code:  
ResetCredentialsActionToken token = new ResetCredentialsActionToken(user.getId(), absoluteExpirationInSecs, authSessionEncodedId, authenticationSession.getClient().getClientId());

I can’t seem to find the right dependency, any help would be appreciated.

Thank you!

---

<div class="post-metadata">

**Author:** ![zonaut](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zonaut/32/666_2.png) [@zonaut](https://forum.keycloak.org/u/zonaut)\
**Post date:** [July 27, 2020, 1:11pm UTC](https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-when-implementing-authenticator/3974/2 "2020-07-27T13:11:48Z")

</div>

Hi,

take a look at the readme in one of the examples I provide. The Keycloak config section points to a configuration you need to make in standalone-ha.xml and declare modules you want to use as global.

> <https://github.com/zonaut/keycloak-extensions/blob/master/spi-registration-profile/README.md>

---

<div class="post-metadata">

**Author:** ![ced](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@ced](https://forum.keycloak.org/u/ced)\
**Post date:** [July 27, 2020, 3:14pm UTC](https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-when-implementing-authenticator/3974/3 "2020-07-27T15:14:53Z")

</div>

Thank you zonaut, this actually fixed my problem.

I can probably figure the following by myself, but in case you’re aware of it already, do i still need to include the keycloak-service in my POM dependency or the global-modules setting is sufficient?

---

<div class="post-metadata">

**Author:** ![zonaut](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zonaut/32/666_2.png) [@zonaut](https://forum.keycloak.org/u/zonaut)\
**Post date:** [July 27, 2020, 4:04pm UTC](https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-when-implementing-authenticator/3974/4 "2020-07-27T16:04:16Z")

</div>

If it compiles, builds and runs without …

---

<div class="post-metadata">

**Author:** ![zonaut](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zonaut/32/666_2.png) [@zonaut](https://forum.keycloak.org/u/zonaut)\
**Post date:** [August 8, 2020, 2:14pm UTC](https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-when-implementing-authenticator/3974/5 "2020-08-08T14:14:13Z")

</div>

Quick update in this issue, there is no need to define the global-modules in the standalone-ha.xml file.  
My mistake was putting the jboss-deployment-structure.xml file in the wrong directory in the examples, these need to be under the META-INF folder. The repo contains correct examples now.
