Starts in:
2 DAYS
19 HRS
21 MIN
24 SEC
Starts in:
2 D
19 H
21 M
24 S
Open Closed

Error while creating new microservice project #8235


User avatar
0
duongdangquoc@gmail.com created
  • ABP Framework version: v8.3.1
  • UI Type: MVC
  • Database System: EF Core (SQL Server) / MongoDB
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace: 2024-11-06 16:27:09.312 +07:00 [INF] Sending HTTP request GET http://localhost:44322/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 2024-11-06 16:27:11.207 +07:00 [INF] Received HTTP response headers after 1893.3172ms - 200 2024-11-06 16:27:11.210 +07:00 [INF] End processing HTTP request after 1908.0361ms - 200 2024-11-06 16:27:11.258 +07:00 [INF] Start processing HTTP request GET http://localhost:44322/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0 2024-11-06 16:27:11.258 +07:00 [INF] Sending HTTP request GET http://localhost:44322/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0 2024-11-06 16:27:11.724 +07:00 [INF] Received HTTP response headers after 466.1528ms - 200 2024-11-06 16:27:11.725 +07:00 [INF] End processing HTTP request after 467.0009ms - 200 2024-11-06 16:27:11.971 +07:00 [DBG] Get dynamic claims cache for user: 60cd42b7-b510-7522-219f-3a15c02808ce 2024-11-06 16:27:11.973 +07:00 [DBG] Refresh dynamic claims for user: 60cd42b7-b510-7522-219f-3a15c02808ce from remote service. 2024-11-06 16:27:11.975 +07:00 [INF] Start processing HTTP request POST http://localhost:44331/api/account/dynamic-claims/refresh 2024-11-06 16:27:11.975 +07:00 [INF] Sending HTTP request POST http://localhost:44331/api/account/dynamic-claims/refresh 2024-11-06 16:27:13.921 +07:00 [INF] Received HTTP response headers after 1946.4158ms - 200 2024-11-06 16:27:13.922 +07:00 [INF] End processing HTTP request after 1946.7416ms - 200 2024-11-06 16:27:13.924 +07:00 [WRN] Failed to refresh remote dynamic claims cache for user: 60cd42b7-b510-7522-219f-3a15c02808ce Volo.Abp.AbpException: Failed to refresh remote claims for user: 60cd42b7-b510-7522-219f-3a15c02808ce at Volo.Abp.Security.Claims.RemoteDynamicClaimsPrincipalContributorCacheBase1.GetAsync(Guid userId, Nullable1 tenantId) at Volo.Abp.Security.Claims.RemoteDynamicClaimsPrincipalContributorBase`2.ContributeAsync(AbpClaimsPrincipalContributorContext context) 2024-11-06 16:27:13.928 +07:00 [INF] Executing endpoint '/DocumentsManagement/DocumentInboxes/Index' 2024-11-06 16:27:13.942 +07:00 [INF] Route matched with {page = "/DocumentsManagement/DocumentInboxes/Index", action = "", controller = "", area = ""}. Executing page /DocumentsManagement/DocumentInboxes/Index 2024-11-06 16:27:13.944 +07:00 [INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy 2024-11-06 16:27:13.965 +07:00 [INF] Start processing HTTP request GET http://localhost:44322/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 2024-11-06 16:27:13.965 +07:00 [INF] Sending HTTP request GET http://localhost:44322/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 2024-11-06 16:27:14.023 +07:00 [INF] Received HTTP response headers after 58.0335ms - 200 2024-11-06 16:27:14.024 +07:00 [INF] End processing HTTP request after 58.4179ms - 200 2024-11-06 16:27:14.025 +07:00 [INF] Start processing HTTP request GET http://localhost:44322/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0 2024-11-06 16:27:14.025 +07:00 [INF] Sending HTTP request GET http://localhost:44322/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0 2024-11-06 16:27:14.119 +07:00 [INF] Received HTTP response headers after 93.2711ms - 200 2024-11-06 16:27:14.119 +07:00 [INF] End processing HTTP request after 93.6022ms - 200 2024-11-06 16:27:14.135 +07:00 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": { "ActivatorChain": "DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel" }, "validationErrors": null }

2024-11-06 16:27:14.135 +07:00 [ERR] An exception was thrown while activating DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel. Autofac.Core.DependencyResolutionException: An exception was thrown while activating DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel. ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel' can be invoked with the available services and parameters: Cannot resolve parameter 'DocumentsManagement.DocumentInboxes.IDocumentInboxesAppService documentInboxesAppService' of constructor 'Void .ctor(DocumentsManagement.DocumentInboxes.IDocumentInboxesAppService)'.

See https://autofac.rtfd.io/help/no-constructors-bindable for more info. at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass14_0.

2024-11-06 16:27:14.140 +07:00 [INF] Executed page /DocumentsManagement/DocumentInboxes/Index in 194.5335ms 2024-11-06 16:27:14.140 +07:00 [INF] Executed endpoint '/DocumentsManagement/DocumentInboxes/Index' 2024-11-06 16:27:14.157 +07:00 [ERR] An unhandled exception has occurred while executing the request. Autofac.Core.DependencyResolutionException: An exception was thrown while activating DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel. ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel' can be invoked with the available services and parameters: Cannot resolve parameter 'DocumentsManagement.DocumentInboxes.IDocumentInboxesAppService documentInboxesAppService' of constructor 'Void .ctor(DocumentsManagement.DocumentInboxes.IDocumentInboxesAppService)'.

See https://autofac.rtfd.io/help/no-constructors-bindable for more info. at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass14_0.

  • Steps to reproduce the issue: Run the application, click the Document Inboxes menu item

I am trying to create my own service (Called DocumentManagement). I created a DocumentService (microservice infrastructure) and DocumentsManagement (DDD Principle). After running the application, I am facing with 2 issues: The first one is an exception I have posted log above The second is swagger error (status code is 502) when trying to access the APIs at /swagger/index.html?urls.primaryName=Documents%20API

You can teach me what I wrong, how to does not repeat in the future. Is there any detailed documentation to implement step by step.

If the supporter is maliming, you should access my Github (Shared with you last time) and run the application.

Many thanks.


31 Answer(s)
  • User Avatar
    0
    duongdangquoc@gmail.com created

    Hi maliming,

    I created some APIs to get data from other microservices, I also created C# proxies based on your comment above.

    After running the application, I got the exception:

    Message: The API description of the TSD.DOCS.AdminCategoryService.ListOrganizations.IListOrganizationsAppService.GetForSelectListAsync method was not found!

    StackTrace:

    at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.BuildHttpProxyClientProxyContext(String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at TSD.DOCS.AdminCategoryService.ListOrganizations.ListOrganizationClientProxy.GetForSelectListAsync(Nullable`1 id) in E:\Workspaces\AbpFramework\Projects\TSD.DOCS\services\admin\category\src\TSD.DOCS.AdminCategoryService.HttpApi\ClientProxies\TSD\DOCS\AdminCategoryService\ListOrganizations\ListOrganizationClientProxy.Generated.cs:line 23 at DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.CreateModalModelBase.OnGetAsync() in E:\Workspaces\AbpFramework\Projects\TSD.DOCS\services\documents-management\src\DocumentsManagement.Web\Pages\DocumentsManagement\DocumentInboxes\CreateModal.cshtml.cs:line 36 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.NonGenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()

    Could you please help me double check? There is how to reproduce:

    BTW, what is the different between proxy generation in Abp Studio and command line?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The ClientProxies should exist on the HttpApi.Client project.

  • User Avatar
    0
    duongdangquoc@gmail.com created

    Thank you.

    I have one more question here. In \services\documents-management\src\DocumentsManagement.Web\Pages\DocumentsManagement\DocumentInboxes\CreateModal.cshtml.cs line 36 I called directly from another service but got this error: "Your request is not valid!" What I wrong here?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    long? id = null

    Please try to use a DTO instead of long? id as parameter.

  • User Avatar
    0
    duongdangquoc@gmail.com created

    Hi mailiming,

    I have added some menu items as you know (Documents, categories). But when the token expired, the UI shows a prompt message instead of redirecting to the authorize page look like built-in modules

    How do we resolve this issue?

    Thank you.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    If you want to redirect to the login page for all 401 or 403, you can override the abp.ajax.handleErrorStatusCode in a global javascript.

    https://abp.io/docs/latest/framework/ui/mvc-razor-pages/javascript-api/ajax#log-show-errors

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06