create-realm ssoadm command fails in AM 5 with Guice configuration errors
The purpose of this article is to provide assistance if you encounter "Exception in thread "main" com.google.inject.ConfigurationException: Guice configuration errors" when trying to create a new realm in AM 5 using the ssoadm create-realm command.
1 reader recommends this article
This article has been archived and is no longer maintained by ForgeRock.
Using the create-realm ssoadm command fails with the following exception:Exception in thread "main" com.google.inject.ConfigurationException: Guice configuration errors: 1) No implementation for org.forgerock.openam.notifications.NotificationBroker annotated with interface org.forgerock.openam.notifications.LocalOnly was bound. while locating org.forgerock.openam.notifications.NotificationBroker annotated with interface org.forgerock.openam.notifications.LocalOnly 1 error at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004) at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1009) at org.forgerock.guice.core.InjectorHolder.getInstance(InjectorHolder.java:85) at com.sun.identity.idm.plugins.internal.AgentsRepo.<init>(AgentsRepo.java:183) at com.sun.identity.sm.OrganizationConfigManager.createSubOrganization(OrganizationConfigManager.java:344) at com.sun.identity.cli.realm.CreateRealm.handleRequest(CreateRealm.java:86) at com.sun.identity.cli.SubCommand.execute(SubCommand.java:296) at com.sun.identity.cli.CLIRequest.process(CLIRequest.java:217) at com.sun.identity.cli.CLIRequest.process(CLIRequest.java:139) at com.sun.identity.cli.CommandManager.serviceRequestQueue(CommandManager.java:581) at com.sun.identity.cli.CommandManager.<init>(CommandManager.java:178) at com.sun.identity.cli.CommandManager.main(CommandManager.java:155
This occurs when you use a command such as the following:$ ./ssoadm create-realm -e /newRealm -u amadmin -f pwd.txt
The realm is partially created and can be seen in the console, but critical elements such as the data store, services and authentication modules do not exist, so the realm is not fully functional.
Upgraded to, or installed AM 5.
There is a missing guice dependency; ssoadm needs its own guice mappings (dependencies) that are separate to the core server ones. In this instance, core classes were changed and new guice dependencies added, but they were not added to ssoadm as well.
This issue can be resolved by upgrading to AM 5.1 or later; you can download this from BackStage.
A suggested workaround for this issue is to use Amster instead to automate realm creation as detailed in Entity Reference › Amster Entity Reference › Realms.
Amster was introduced in AM 5 as a new command-line interface built upon the AM REST interface. Amster will replace ssoadm in a future release.
How do I update property values in AM (All versions) using Amster?
Entity Reference › Amster Entity Reference › Realms
Related Issue Tracker IDs
OPENAM-11034 (OpenAM 14.0.0 (AM5) ssoadm create-realm error)