Hello,
I have not had a moment to complete your request. I will get back to you soon.
Thanks!
Thanks for your reply. I tested it with the addition of the EventNameAttribute
and I receive the same error.
I did not think that would work anyway, as the error in my initial comment says Value cannot be null. (Parameter 'returnType')
and the method that throws is System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
If i understand the error correctly, it cannot determine the type to deserialze as from the outbox json blob. This only happens with the abp.dapr addition. without abp.dapr, the type is deserialzed from the outbox just fine. there are no errors showing anywhere else in any process' logs. dapr sidecar and zipkin are working just fine too.
Update:
I've stepped through ABP's code.
Volo.Abp.EventBus.Dapr.DaprDistributedEventBus
PublishManyFromOutboxAsync
-> PublishToDaprAsync
-> GetEventType
-> EventTypes.GetOrDefault(eventName)
: EventTypes
does not have a key and value for the EventNameAttribute
or the full type name (PaymentTerm_UpdatedEto
).
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ ✔ Check the samples to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index ✔ The exact solution to your question may have been answered before, and please first use the search on the homepage. ✔
Provide us with the following info:
System.ArgumentNullException: Value cannot be null. (Parameter 'returnType')
at System.Text.Json.ThrowHelper.ThrowArgumentNullException(String parameterName)
at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
at Volo.Abp.Json.SystemTextJson.AbpSystemTextJsonSerializer.Deserialize(Type type, String jsonString, Boolean camelCase) in C:\source\AppEngine\AppEngine\abp\framework\src\Volo.Abp.Json.SystemTextJson\Volo\Abp\Json\SystemTextJson\AbpSystemTextJsonSerializer.cs:line 30
at Volo.Abp.Dapr.Utf8JsonDaprSerializer.Deserialize(Byte[] value, Type type) in C:\source\AppEngine\AppEngine\abp\framework\src\Volo.Abp.Dapr\Volo\Abp\Dapr\Utf8JsonDaprSerializer.cs:line 24
at Volo.Abp.EventBus.Dapr.DaprDistributedEventBus.PublishManyFromOutboxAsync(IEnumerable`1 outgoingEvents, OutboxConfig outboxConfig) in C:\source\AppEngine\AppEngine\abp\framework\src\Volo.Abp.EventBus.Dapr\Volo\Abp\EventBus\Dapr\DaprDistributedEventBus.cs:line 153
at Volo.Abp.EventBus.Distributed.OutboxSender.PublishOutgoingMessagesInBatchAsync(List`1 waitingEvents) in C:\source\AppEngine\AppEngine\abp\framework\src\Volo.Abp.EventBus\Volo\Abp\EventBus\Distributed\OutboxSender.cs:line 128
at Volo.Abp.EventBus.Distributed.OutboxSender.RunAsync() in C:\source\AppEngine\AppEngine\abp\framework\src\Volo.Abp.EventBus\Volo\Abp\EventBus\Distributed\OutboxSender.cs:line 89
at Volo.Abp.EventBus.Distributed.OutboxSender.RunAsync() in C:\source\AppEngine\AppEngine\abp\framework\src\Volo.Abp.EventBus\Volo\Abp\EventBus\Distributed\OutboxSender.cs:line 106
at Volo.Abp.EventBus.Distributed.OutboxSender.TimerOnElapsed(AbpAsyncTimer arg) in C:\source\AppEngine\AppEngine\abp\framework\src\Volo.Abp.EventBus\Volo\Abp\EventBus\Distributed\OutboxSender.cs:line 68
at Volo.Abp.Threading.AbpAsyncTimer.Timer_Elapsed() in C:\source\AppEngine\AppEngine\abp\framework\src\Volo.Abp.Threading\Volo\Abp\Threading\AbpAsyncTimer.cs:line 105
[Serializable]
public class PaymentTerm_UpdatedEto
{
public PaymentTerm_UpdatedEto() { }
public PaymentTerm_UpdatedEto(
Guid paymentTermId,
PaymentTermEto oldPaymentTerm,
PaymentTermEto newPaymentTerm)
{
Check.NotDefaultOrNull<Guid>(paymentTermId, nameof(paymentTermId));
Check.NotNull(oldPaymentTerm, nameof(oldPaymentTerm));
Check.NotNull(newPaymentTerm, nameof(newPaymentTerm));
PaymentTermId = paymentTermId;
OldPaymentTerm = oldPaymentTerm;
NewPaymentTerm = newPaymentTerm;
}
public Guid PaymentTermId { get; set; }
public PaymentTermEto OldPaymentTerm { get; set; }
public PaymentTermEto NewPaymentTerm { get; set; }
}
[Serializable]
public class PaymentTermEto
{
public Guid Id { get; set; }
public Guid? TenantId { get; set; }
public string Name { get; set; }
}
public class PaymentTerm :
AuditedAggregateRoot<Guid>,
IMultiTenant
{
public PaymentTerm(
Guid id,
string name,
Guid? tenantId = null)
{
Id = id;
SetName(name);
TenantId = tenantId;
}
public string Name { get; protected set; }
public Guid? TenantId { get; protected set; }
private void SetName([NotNull] string name)
{
Check.NotNullOrWhiteSpace(name, nameof(name));
Check.Length(name, nameof(name),
PaymentTermConsts.NameMaxLength, PaymentTermConsts.NameMinLength);
//do not trigger Entity changed event if the value is the same
if (Name?.ToLower() != name.ToLower())
{
PaymentTermEto eto = null;
if (Name != null)
eto = ToEto();
Name = name;
if (null != eto)
PublishChangedEvent(eto);
}
}
private void PublishChangedEvent(PaymentTermEto old)
{
ClearDistributedEvents();
AddDistributedEvent(new PaymentTerm_UpdatedEto(this.Id, old, this.ToEto()));
}
private PaymentTermEto ToEto()
{
return new PaymentTermEto
{
Id = Id,
TenantId = TenantId,
Name = Name
};
}
}
If i do not use the outbox the event is pushed correctly over the dapr bus. Zipkin shows this.
any help is appreciated, thank you for your time
That worked, Thank you!
Also, what is the significance of having the project include then remove those json files?
And will this fix be included in the next release of the Suite?
System.InvalidOperationException: 'The action 'Volo.FileManagement.Files.ClientProxies.FileDescriptorClientProxy.GetAsync (Volo.FileManagement.HttpApi.Client)' has ApiExplorer enabled, but is using conventional routing. Only actions which use attribute routing support ApiExplorer.' at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorBuilder.AddApiExplorerInfo(ControllerActionDescriptor actionDescriptor, ApplicationModel application, ControllerModel controller, ActionModel action) at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorBuilder.CreateActionDescriptor(ApplicationModel application, ControllerModel controller, ActionModel action, SelectorModel selector) at Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModelFactory.Flatten[TResult](ApplicationModel application, Func5 flattener) at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorBuilder.Build(ApplicationModel application) at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors() at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection() at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize() at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.<>c__DisplayClass11_0.<Subscribe>b__0() at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func1 changeTokenProducer, Action changeTokenConsumer) at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.Subscribe() at Microsoft.AspNetCore.Mvc.Routing.ControllerActionEndpointDataSource..ctor(ControllerActionEndpointDataSourceIdProvider dataSourceIdProvider, IActionDescriptorCollectionProvider actions, ActionEndpointFactory endpointFactory, OrderedEndpointsSequenceProvider orderSequence) at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints) at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapControllerRoute(IEndpointRouteBuilder endpoints, String name, String pattern, Object defaults, Object constraints, Object dataTokens) at Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule.<>c.<ConfigureServices>b__1_10(EndpointRouteBuilderContext endpointContext) at Microsoft.AspNetCore.Builder.AbpAspNetCoreApplicationBuilderExtensions.<>c__DisplayClass0_0.<UseConfiguredEndpoints>b__0(IEndpointRouteBuilder endpoints) at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action1 configure) at Microsoft.AspNetCore.Builder.AbpAspNetCoreApplicationBuilderExtensions.UseConfiguredEndpoints(IApplicationBuilder app, Action1 additionalConfigurationAction) at FiveOhTest.Blazor.FiveOhTestBlazorModule.OnApplicationInitialization(ApplicationInitializationContext context) in C:\source\FiveOhTest\src\FiveOhTest.Blazor\FiveOhTestBlazorModule.cs:line 340 at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module) at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)
<SolutionName>.Blazor.<SolutionName>BlazorModule > app.UseConfiguredEndpoints();
throwing the above error.This is with no code changes made, or anything added or removed (besides the addition of the FileManagement Module)