Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

The AccountManagementService is not defined

Avatar

Level 2

When I'm using one of the forms action provided in /libs/foundation/components/account/actions/accountcreationrequest/post.POST.jsp in form for account creation in aem, It is giving me the error in logs "The AccountManagementService is not defined". Please help me in resolving this issue.

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi shreyasgune,

I explained in my blog post about user creation and password reset using the AccountManagementService API in details.

It will help you for resolving your problem.

Go through this link :

Regards

saurabhg43188021

View solution in original post

5 Replies

Avatar

Level 10

Can you point community to the doc you are following to see if this is reproducible please.

Avatar

Level 2

Hi smacdonald2008 ,

Thanks for responding.

I am not following any doc as the "AccountManager" is deprecated in AEM 6.2. So, I used AccountManagementService class for user creation. Below are more details of two approaches I have tried:

1. I have created an form for user creation.It's action type is /libs/foundation/components/account/actions/accountcreationrequest . On submitting the form it redirects to this same page and in logs the error it is showing "The AccountManagementService is not defined".

2. I have also tried to change the action type (from /foundation/components/account/actions/accountrequest to /foundation/components/account/actions/accountcreationrequest ) of the user registration form of geometrixx's demo site and also add password field to it and modify name according to it (i.e. at http://localhost:4502/editor.html/content/geometrixx/en/toolbar/account/accountrequest.html ). But on submitting the form, it is giving me the same error "The AccountManagementService is not defined".

Please help in resolving the error.

Also, please share any article/knowledge base that can help in user creation using form which I can refer. I am working on AEM 6.2 version.

Avatar

Level 10

What you need to do is have a form that posts data to a custom action:

Scott's Digital Community: Creating a custom action for an Adobe Experience Manager Form component

This will post data to a custom OSGi service. IN that custom OSGi service - you can use the AccountManagementService ("The Adobe AEM Quickstart and Web Application.") API.

Avatar

Correct answer by
Level 3

Hi shreyasgune,

I explained in my blog post about user creation and password reset using the AccountManagementService API in details.

It will help you for resolving your problem.

Go through this link :

Regards

saurabhg43188021

Avatar

Level 2

Hi saurabhg43188021,

Thanks for your reply. Yes, we had found your article, "User Creation using AccountManagementService API" and followed the same to solve the issues we were facing. The main issue for which I have opened this thread, i.e. "The AccountManagementService is not defined" got resolved by configuring the "Day CQ mail service" as stated in your article.

However, to complete the flow of user creation, we were not able to set up whole configuration for the SMTP server properly - we are using internal SMTP server and not the gmail SMTP server as shown in your blog post. So, on our internal server, we were not able to send mail from AEM server. To fix this, we had to set the "from" address (i.e. the "account@cq5.com") to our email address (i.e. something like <myemailid@mycompany.com>). We found this setting in "/etc/security/accountmgr/jcr:content/requestnewaccount" .