Open Closed

FindActionAsync : Could not found remote action for method #1624


User avatar
0
serkan.karacasulu created

I setup with microservice template. I get this error only from EgitimYerleriController.

  • ABP Framework version: v4.3.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: [web_708fb78d-f]: [11:03:22 ERR] Could not found remote action for method: System.Threading.Tasks.Task1[Volo.Abp.Application.Dtos.PagedResultDto1[MBB.EgitimService.Egt.EgitimYerleri.Dtos.EgitimYeriDto]] GetListAsync(Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto) on the URL: https://localhost:44325/ [web_708fb78d-f]: Volo.Abp.AbpException: Could not found remote action for method: System.Threading.Tasks.Task1[Volo.Abp.Application.Dtos.PagedResultDto1[MBB.EgitimService.Egt.EgitimYerleri.Dtos.EgitimYeriDto]] GetListAsync(Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto) on the URL: https://localhost:44325/ [web_708fb78d-f]: at Volo.Abp.Http.Client.DynamicProxying.ApiDescriptionFinder.FindActionAsync(HttpClient client, String baseUrl, Type serviceType, MethodInfo method) [web_708fb78d-f]: at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.MakeRequestAsync(IAbpMethodInvocation invocation) [web_708fb78d-f]: at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.MakeRequestAndGetResultAsync[T](IAbpMethodInvocation invocation) [web_708fb78d-f]: at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.GetResultAsync(Task task, Type resultType) [web_708fb78d-f]: at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.InterceptAsync(IAbpMethodInvocation invocation) [web_708fb78d-f]: at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) [web_708fb78d-f]: at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) [web_708fb78d-f]: at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() [web_708fb78d-f]: at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) [web_708fb78d-f]: at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) [web_708fb78d-f]: at MBB.EgitimService.EgitimCrudController4.GetListAsync(PagedAndSortedResultRequestDto input) in C:\Users\serkan.karacasulu\Desktop\MBB-MicroService\services\egitim\src\MBB.EgitimService.HttpApi\EgitimServiceController.cs:line 45 [web_708fb78d-f]: at lambda_method2660(Closure , Object ) [web_708fb78d-f]: at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) [web_708fb78d-f]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker) [web_708fb78d-f]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) [web_708fb78d-f]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) [web_708fb78d-f]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) [web_708fb78d-f]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() [web_708fb78d-f]: --- End of stack trace from previous location --- [web_708fb78d-f]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) [web_708fb78d-f]: [11:03:22 INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'. [web_708fb78d-f]: [11:03:22 INF] Executed action MBB.EgitimService.Egt.EgitimYerleri.EgitimYeriController.GetListAsync (MBB.EgitimService.HttpApi) in 43.6299ms [web_708fb78d-f]: [11:03:22 INF] Executed endpoint 'MBB.EgitimService.Egt.EgitimYerleri.EgitimYeriController.GetListAsync (MBB.EgitimService.HttpApi)' [web_708fb78d-f]: [11:03:22 INF] Request finished HTTP/2 GET https://localhost:44321/api/egitim-service/egitim-yerleri?sorting=&skipCount=0&maxResultCount=10 application/json - - 500 - application/json;+charset=utf-8 46.8141ms
namespace MBB.EgitimService.Egt.EgitimYerleri
{
    [RemoteService(Name = EgitimServiceRemoteServiceConsts.RemoteServiceName)]
    [Area("egitimService")]
    [Route("api/egitim-service/egitim-yerleri")]
    public class EgitimYeriController : EgitimCrudFullController<EgitimYeriDto, int, CreateUpdateEgitimYeriDto, CreateUpdateEgitimYeriDto>
    {
        public EgitimYeriController(IEgitimYeriAppService service) : base(service)
        {

        }
    }
}

namespace MBB.EgitimService
{
    public abstract class EgitimServiceController : AbpController
    {
        protected EgitimServiceController()
        {
            LocalizationResource = typeof(EgitimServiceResource);
        }
    }
    public abstract class EgitimCrudController<TEntityDto, TKey, TCreateInput, TUpdateInput> : EgitimServiceController where TEntityDto : IEntityDto<TKey>
    {
        private readonly ICrudAppService<TEntityDto, TKey, PagedAndSortedResultRequestDto, TCreateInput, TUpdateInput> _appService;
        public EgitimCrudController(ICrudAppService<TEntityDto, TKey, PagedAndSortedResultRequestDto, TCreateInput, TUpdateInput> appService)
        {
            _appService = appService;
        }
        [HttpPost]
        public async Task<TEntityDto> CreateAsync(TCreateInput input)
        {
            return await _appService.CreateAsync(input);
        }

        [HttpDelete]
        [Route("{id}")]
        public async Task DeleteAsync(TKey id)
        {
            await _appService.DeleteAsync(id);
        }
        [HttpGet]
        [Route("{id}")]
        public virtual async Task<TEntityDto> GetAsync(TKey id)
        {
            return await _appService.GetAsync(id);
        }
        [HttpGet]
        public virtual async Task<PagedResultDto<TEntityDto>> GetListAsync(PagedAndSortedResultRequestDto input)
        {
            return await _appService.GetListAsync(input);
        }
        [HttpPut]
        [Route("{id}")]
        public virtual async Task<TEntityDto> UpdateAsync(TKey id, TUpdateInput input)
        {
            return await _appService.UpdateAsync(id, input);
        }
    }

    public abstract class EgitimCrudSearchController<TEntityDto, TKey, TCreateInput, TUpdateInput> : EgitimCrudController<TEntityDto, TKey, TCreateInput, TUpdateInput> where TEntityDto : IEntityDto<TKey>, new()
    {
        private readonly IFullCrudAppService<TEntityDto, TKey, PagedAndSortedResultRequestDto, TCreateInput, TUpdateInput> _appService;
        public EgitimCrudSearchController(IFullCrudAppService<TEntityDto, TKey, PagedAndSortedResultRequestDto, TCreateInput, TUpdateInput> appService) : base(appService)
        {
            _appService = appService;
        }

        [HttpGet]
        [Route("search")]
        public virtual async Task<PagedResultDto<TEntityDto>> GetListSearchAsync(PagedAndSortedAndSearchedResultRequestDto<TEntityDto> input)
        {
            return await _appService.GetListSearchAsync(input);
        }
    }

    public abstract class EgitimCrudFullController<TEntityDto, TKey, TCreateInput, TUpdateInput> : EgitimCrudController<TEntityDto, TKey, TCreateInput, TUpdateInput> where TEntityDto : IEntityDto<TKey>, new()
    {
        private readonly IFullCrudLookupAppService<TEntityDto, TKey, TCreateInput, TUpdateInput> _appService;
        public EgitimCrudFullController(IFullCrudLookupAppService<TEntityDto, TKey, TCreateInput, TUpdateInput> appService) : base(appService)
        {
            _appService = appService;
        }

        [HttpGet]
        [Route("search")]
        public virtual async Task<PagedResultDto<TEntityDto>> GetListSearchAsync(PagedAndSortedAndSearchedResultRequestDto<TEntityDto> input)
        {
            return await _appService.GetListSearchAsync(input);
        }
        [HttpGet]
        [Route("lookup")]
        public virtual async Task<PagedResultDto<Lookup<TKey>>> GetLookup(string filter, int skipCount = 0, int maxResultCount = 10)
        {
            return await _appService.GetLookup(filter, skipCount, maxResultCount);
        }
        [HttpGet]
        [Route("{id}/lookup")]
        public virtual async Task<Lookup<TKey>> GetLookup(TKey id)
        {
            return await _appService.GetLookup(id);
        }
    }
}


1 Answer(s)
  • User Avatar
    0
    serkan.karacasulu created

    I forgot to give interface on controller.

    namespace MBB.EgitimService.Egt.EgitimYerleri
    {
        [RemoteService(Name = EgitimServiceRemoteServiceConsts.RemoteServiceName)]
        [Area("egitimService")]
        [Route("api/egitim-service/egitim-yerleri")]
        public class EgitimYeriController : EgitimCrudFullController<EgitimYeriDto, int, CreateUpdateEgitimYeriDto, CreateUpdateEgitimYeriDto>, IEgitimYeriAppService
        {
            public EgitimYeriController(IEgitimYeriAppService service) : base(service)
            {
    
            }
        }
    }
    
Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19