WrenSecurity/wrends

OpenIDM Account Change Notification Handler Does Not Package Properly on Windows

Opened this issue · 0 comments

Affected Versions

  • 3.5.1

Summary

If you build the Wren:DS project on Windows, the artifacts that get produced for the "OpenIDM Account Change Notification Handler" do not contain the correct files. This leads to duplicate JAR files inside the opendj-openidm-account-change-notification-handler-3.5.1.zip file, and a missing extensions manifest file inside the opendj-openidm-account-change-notification-handler-3.5.1.jar file.

Environment

  • Windows 10 - Version 1709 (OS Build 16299.309)
  • Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T14:49:05-05:00)

Steps to Reproduce

  1. Build Wren:DS 3.5.1 from source on a Windows 10 machine.
  2. Using the ZIP file under opendj-openidm-account-change-notification-handler/target, attempt to follow plug-in installation instructions from ForgeRock.

Note that step 5 in FR's documentation is incorrect; the command should be:

cd /path/to/opendj/bin
./ldapmodify \
 --port 389 \
 --bindDN "cn=Directory Manager" \
 --bindPassword "password" \
 --defaultAdd \
 --filename \
 ../config/openidm-accountchange-plugin-sample-config

Expected Results

  • The plug-in can be installed successfully (even with the default, sample config).

Actual Results

  • The ZIP file contains two JAR files under lib/extensions (opendj-openidm-account-change-notification-handler-3.5.1.jar and opendj-openidm-account-change-notification-handler-3.5.1-shaded.jar), when it should only contain one.
  • The JAR inside the ZIP file is missing the appropriate manifest file (org.forgerock.opendj.config.AbstractManagedObjectDefinition).
  • Attempting to use the JAR file without that manifest leads to the following error message when trying to install the plug-in:

The Directory Server is unwilling to add configuration entry cn=OpenIDM Notification Handler,cn=Account Status Notification Handlers,cn=config because one of the add listeners registered with the parent entry cn=Account Status Notification Handlers,cn=config rejected this change with the message: An error occurred while trying to initialize an instance of class org.forgerock.openidm.accountchange.OpenidmAccountStatusNotificationHandler as an account status notification handler as defined in configuration entry cn=OpenIDM Notification Handler,cn=Account Status Notification Handlers,cn=config: ClassCastException: org.forgerock.opendj.server.config.meta.AccountStatusNotificationHandlerCfgDefn$AccountStatusNotificationHandlerCfgServerImpl cannot be cast to org.forgerock.openidm.accountchange.server.OpenidmAccountStatusNotificationHandlerCfg (OpenidmAccountStatusNotificationHandler.java:221 AccountStatusNotificationHandlerConfigManager.java:360 AccountStatusNotificationHandlerConfigManager.java:225 AccountStatusNotificationHandlerConfigManager.java:48 ServerManagedObjectAddListenerAdaptor.java:66 ConfigAddListenerAdaptor.java:221 ConfigurationHandler.java:463 ConfigurationBackend.java:404 LocalBackendAddOperation.java:460 LocalBackendAddOperation.java:161 LocalBackendWorkflowElement.java:736 LocalBackendWorkflowElement.java:1051 LocalBackendWorkflowElement.java:894 AddOperationBasis.java:506 TraditionalWorkerThread.java:148)

The error results from Wren:DS not bootstrapping the configuration classes while loading the extension, which in turn means that the classes are not loaded by the time it needs to provide them to the extension. The extension tries to typecast the configuration to match the expected configuration type, but fails because Wren:DS is using only the generic configuration definition instead of the one for the plug-in.

Additional Information

The issue appears to be platform-specific. Packaging this on Ubuntu Linux 16.04 with Apache Maven 3.3.9 worked fine.