Hi,
We implemented the Blazor WebAssembly app as a SaaS model in microservice template on abp 7.2.2 version
Added a Chat Module as a package. but chat page not loading. getting the below issue.
- ABP Framework version: v7.2.2
- UI type: Blazor WebAssembly
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
31 Answer(s)
-
0
-
0
-
0
HI,
Can you share the error logs? Gateway and chat service. thanks.
-
0
Hi
Here are the logs,
**Chat Log: **
2023-06-08 17:32:26.217 +08:00 [INF] Request origin https://localhost:44307 does not have permission to access the resource. 2023-06-08 17:32:26.506 +08:00 [INF] Executing endpoint 'Volo.Chat.Users.ContactController.GetTotalUnreadMessageCountAsync (Volo.Chat.HttpApi)' 2023-06-08 17:32:26.526 +08:00 [INF] Route matched with {area = "chat", action = "GetTotalUnreadMessageCount", controller = "Contact"}. Executing controller action with signature System.Threading.Tasks.Task
1[System.Int32] GetTotalUnreadMessageCountAsync() on controller Volo.Chat.Users.ContactController (Volo.Chat.HttpApi). 2023-06-08 17:32:26.604 +08:00 [INF] Executing action method Volo.Chat.Users.ContactController.GetTotalUnreadMessageCountAsync (Volo.Chat.HttpApi) - Validation state: "Valid" 2023-06-08 17:32:26.768 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:b4b82d66-d14b-a8ac-fac8-3a0b83a99d0a,n:Chat.Messaging 2023-06-08 17:32:26.779 +08:00 [DBG] Found in the cache: pn:U,pk:b4b82d66-d14b-a8ac-fac8-3a0b83a99d0a,n:Chat.Messaging 2023-06-08 17:32:26.782 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:Chat.Messaging 2023-06-08 17:32:26.788 +08:00 [DBG] Found in the cache: pn:R,pk:admin,n:Chat.Messaging 2023-06-08 17:32:26.790 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:Blazor,n:Chat.Messaging 2023-06-08 17:32:26.796 +08:00 [DBG] Found in the cache: pn:C,pk:Blazor,n:Chat.Messaging 2023-06-08 17:32:26.886 +08:00 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": { "ActivatorChain": "Volo.Chat.EntityFrameworkCore.ChatDbContext -> λ:Microsoft.EntityFrameworkCore.DbContextOptions
1[[Volo.Chat.EntityFrameworkCore.ChatDbContext, Volo.Chat.EntityFrameworkCore, Version=7.2.2.0, Culture=neutral, PublicKeyToken=null]]" }, "validationErrors": null }2023-06-08 17:32:26.886 +08:00 [ERR] An exception was thrown while activating Volo.Chat.EntityFrameworkCore.ChatDbContext -> λ:Microsoft.EntityFrameworkCore.DbContextOptions
1[[Volo.Chat.EntityFrameworkCore.ChatDbContext, Volo.Chat.EntityFrameworkCore, Version=7.2.2.0, Culture=neutral, PublicKeyToken=null]]. Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Chat.EntityFrameworkCore.ChatDbContext -> λ:Microsoft.EntityFrameworkCore.DbContextOptions
1[[Volo.Chat.EntityFrameworkCore.ChatDbContext, Volo.Chat.EntityFrameworkCore, Version=7.2.2.0, Culture=neutral, PublicKeyToken=null]]. ---> Volo.Abp.AbpException: No configuration found for Microsoft.EntityFrameworkCore.DbContext, Microsoft.EntityFrameworkCore, Version=7.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60! Use services.Configure<AbpDbContextOptions>(...) to configure it. at Volo.Abp.EntityFrameworkCore.DependencyInjection.DbContextOptionsFactory.Configure[TDbContext](AbpDbContextOptions options, AbpDbContextConfigurationContext1 context) at Volo.Abp.EntityFrameworkCore.DependencyInjection.DbContextOptionsFactory.Create[TDbContext](IServiceProvider serviceProvider) at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters) at Autofac.Core.Activators.Delegate.DelegateActivator.<ConfigurePipeline>b__2_0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action
1 next) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) --- End of inner exception stack trace --- at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action
1 next) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action
1 next) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable
1 parameters) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.CreateDbContextAsync(IUnitOfWork unitOfWork) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider
1.CreateDbContextAsync(IUnitOfWork unitOfWork, String connectionStringName, String connectionString) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.GetDbContextAsync() at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository
2.GetDbSetAsync() at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository2.GetQueryableAsync() at Volo.Chat.EntityFrameworkCore.Conversations.EfCoreConversationRepository.GetTotalUnreadMessageCountAsync(Guid userId, CancellationToken cancellationToken) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed) at Volo.Chat.Users.ContactAppService.GetTotalUnreadMessageCountAsync() at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Features.FeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter
1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync() at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter
1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync() at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope) at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter
1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed) at lambda_method1301(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 2023-06-08 17:32:26.888 +08:00 [ERR] ---------- Exception Data ---------- ActivatorChain = Volo.Chat.EntityFrameworkCore.ChatDbContext -> λ:Microsoft.EntityFrameworkCore.DbContextOptions`1[[Volo.Chat.EntityFrameworkCore.ChatDbContext, Volo.Chat.EntityFrameworkCore, Version=7.2.2.0, Culture=neutral, PublicKeyToken=null]] -
0
No configuration found for Microsoft.EntityFrameworkCore.DbContext, Microsoft.EntityFrameworkCore, Version=7.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60! Use services.Configure<AbpDbContextOptions>(...) to configure it.
You are installing the chat module to product service, right? You can try:
public class ProductServiceDbContext : AbpDbContext<ProductServiceDbContext>, IChatDbContext .... context.Services.AddAbpDbContext<ProductServiceDbContext>(options => { options.ReplaceDbContext<IChatDbContext>(); options.AddDefaultRepositories(includeAllEntities: true); });
-
0
-
0
Hi,
You need to configure the SignalR URL.
For example:
Configure<ChatBlazorWebAssemblyOptions>(options => { options.SignalrUrl = builder.Configuration["RemoteServices:Chat:BaseUrl"]; });
-
0
Hi,
You need to configure the SignalR URL.
For example:
Configure<ChatBlazorWebAssemblyOptions>(options => { options.SignalrUrl = builder.Configuration["RemoteServices:Chat:BaseUrl"]; });
Hi,
Where i should write this line Product service? and should i update anything in app settings of Product service?
-
0
Hi,
You should write this in the
Blazor
app.and should i update anything in app settings of Product service?
No, you don't.
Could not find VoloChatAvatarManager.createCanvasForUser
You can try running the
abp bundle
command in the Blazor app folder. -
0
-
0
Hi,
It's just an example; you should replace the
builder.Configuration["RemoteServices:Chat:BaseUrl"];
with the real URL.Gateway URL or Product service URL.
-
0
-
0
Update the gateway config file:
{ "ServiceKey": "Signalr Service", "DownstreamPathTemplate": "/signalr-hubs/{everything}", "DownstreamScheme": "wss", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44361 } ], "UpstreamPathTemplate": "/signalr-hubs/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] },
-
0
-
0
Hi,
Can you share the project with me? I will check it out
-
0
My email is shiwei.liang@volosoft.com
-
0
-
0
Sorry, I am missing a verb.
You can remove the
UpstreamHttpMethod
to allow any verbs:{ "ServiceKey": "Signalr Service", "DownstreamPathTemplate": "/signalr-hubs/{everything}", "DownstreamScheme": "wss", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44361 } ], "UpstreamPathTemplate": "/signalr-hubs/{everything}" }
-
0
-
0
Hi,
Can you share the project with me? shiwei.liang@volosoft.com, I will check it out. I think this can save you time.
-
0
Hi,
I uploaded and shared the source code to you email id shiwei.liang@volosoft.com.
you may check.
-
0
Hi,
Steps:
- Update the appsettings.json
"RemoteServices": { "AbpIdentity": { "BaseUrl": "https://localhost:44388/", "UseCurrentAccessToken": "false" } }, "IdentityClients": { "Default": { "GrantType": "client_credentials", "ClientId": "AdministrationService", "ClientSecret": "1q2w3e*", "Authority": "https://localhost:44322", "Scope": "IdentityService", "RequireHttps": "true", "ValidateIssuerName": "true", "ValidateEndpoints ": "true" } },
- Grant user lookup permission to AdministrationService
You can create an application named
ProductService
instead of usingAdministrationService
- Add package references
<PackageReference Include="Volo.Abp.Identity.Pro.HttpApi.Client" Version="7.2.2" /> <PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="7.2.2" />
[DependsOn(typeof(AbpHttpClientIdentityModelWebModule))] [DependsOn(typeof(AbpIdentityHttpApiClientModule))] public class ProductServiceHttpApiHostModule : AbpModule
- Update
ProductServiceHttpApiHostModule
public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); var env = context.GetEnvironment(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.Use(async (httpContext, next) => { var accessToken = httpContext.Request.Query["access_token"]; var path = httpContext.Request.Path; if (!string.IsNullOrEmpty(accessToken) && (path.StartsWithSegments("/signalr-hubs/chat"))) { httpContext.Request.Headers["Authorization"] = "Bearer " + accessToken; } await next(); }); ........ }
-
0
-
0
Hi,
Now Application loading and chat working.
but may i know why we should use web reference in host module?
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="7.2.2" />
since my project is Blazor web assembly.
-
0
Hi,
Because the product service needs to load user information from the identity service and the package was added to
ProductService.HttpAPI.Host
not the Blazor app.