abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.91k stars 3.44k forks source link

Volo.Abp.BackgroundJobs.BackgroundJobStore facing issue for this entire error stack is given below #18600

Open nayanranjane opened 10 months ago

nayanranjane commented 10 months ago

An exception was thrown while activating Volo.Abp.BackgroundJobs.BackgroundJobStore -> Volo.Abp.ObjectMapping.DefaultObjectMapper1[[Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule, Volo.Abp.BackgroundJobs.Domain, Version=4.2.1.0, Culture=neutral, PublicKeyToken=null]] -> Volo.Abp.AutoMapper.AutoMapperAutoObjectMappingProvider1[[Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule, Volo.Abp.BackgroundJobs.Domain, Version=4.2.1.0, Culture=neutral, PublicKeyToken=null]] -> ?:Volo.Abp.AutoMapper.IMapperAccessor -> ?:Volo.Abp.AutoMapper.MapperAccessor. Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Abp.BackgroundJobs.BackgroundJobStore -> Volo.Abp.ObjectMapping.DefaultObjectMapper1[[Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule, Volo.Abp.BackgroundJobs.Domain, Version=4.2.1.0, Culture=neutral, PublicKeyToken=null]] -> Volo.Abp.AutoMapper.AutoMapperAutoObjectMappingProvider1[[Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule, Volo.Abp.BackgroundJobs.Domain, Version=4.2.1.0, Culture=neutral, PublicKeyToken=null]] -> ?:Volo.Abp.AutoMapper.IMapperAccessor -> ?:Volo.Abp.AutoMapper.MapperAccessor. ---> System.ArgumentException: GenericArguments[0], 'System.Guid', on 'T MaxIntegerT' violates the constraint of type 'T'. ---> System.Security.VerificationException: Method System.Linq.Enumerable.MaxInteger: type argument 'System.Guid' violates the constraint of type parameter 'T'. at System.RuntimeMethodHandle.GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[] methodInstantiation) at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation) --- End of inner exception stack trace --- at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e) at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation) at AutoMapper.TypeDetails.<>cDisplayClass28_1.b10(MethodInfo extensionMethod) at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Enumerable.ConcatIterator1.MoveNext() at System.Linq.Enumerable.SelectManyIterator[TSource,TCollection,TResult](IEnumerable1 source, Func2 collectionSelector, Func3 resultSelector)+MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.HashSet1.UnionWith(IEnumerable1 other) at System.Linq.Enumerable.UnionIterator1.FillSet() at System.Linq.Enumerable.UnionIterator1.ToArray() at AutoMapper.TypeDetails.BuildPublicNoArgExtensionMethods(IEnumerable1 sourceExtensionMethodSearch) at AutoMapper.TypeDetails..ctor(Type type, ProfileMap config) at AutoMapper.ProfileMap.TypeDetailsFactory(Type type) at AutoMapper.Internal.LockingConcurrentDictionary2.<>cDisplayClass2_1.<.ctor>b1() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at AutoMapper.Internal.LockingConcurrentDictionary2.GetOrAdd(TKey key) at AutoMapper.ProfileMap.CreateTypeDetails(Type type) at AutoMapper.TypeMapFactory.CreateTypeMap(Type sourceType, Type destinationType, ProfileMap options, Boolean isReverseMap) at AutoMapper.ProfileMap.BuildTypeMap(IConfigurationProvider configurationProvider, ITypeMapConfiguration config) at AutoMapper.ProfileMap.Register(IConfigurationProvider configurationProvider) at AutoMapper.MapperConfiguration.Seal() at AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression) at AutoMapper.MapperConfiguration..ctor(Action1 configure) at Volo.Abp.AutoMapper.AbpAutoMapperModule.CreateMappings(IServiceProvider serviceProvider) at Autofac.Extensions.DependencyInjection.AutofacRegistration.<>c__DisplayClass3_0.<Register>b__0(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Activators.Delegate.DelegateActivator.<ConfigurePipeline>b__2_0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 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, Action1 next) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.Execute(ResolveRequest request) at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Volo.Abp.BackgroundJobs.BackgroundJobWorker.DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) at Volo.Abp.BackgroundWorkers.AsyncPeriodicBackgroundWorkerBase.DoWorkAsync()

maliming commented 10 months ago

hi

nayanranjane commented 10 months ago

using one abp commertial here are sample steps to reproduce the issue services.AddApplication(); services.AddDbContext(); services.ConfigureMultiTenancy(); services.ConfigureHttpClientProxies(); services.ConfigureAutoMapper(); services.ConfigureDI();

nayanranjane commented 10 months ago

I have legacy code which is using all the abp commertial version of 4.2 and I have created this as a shared project now I am using this shared project in .net 5 project which is working fine but when I try to use the same shared code in .net core 7 Project I am getting above error for backgroundJobs please advice

maliming commented 10 months ago

I can't reproduce the problem based on the information you provided.

nayanranjane commented 10 months ago

Just want to know can we use entire abp.comertial version project which is in 4.2 can we use this all volo libraries in .net core 7

maliming commented 10 months ago

hi

All abp 4.2 packages target is net5.0. I think you can't use it in net 7.

CodeOutput commented 1 month ago

2024-09-05 17:53:19.067 +03:00 [ERR] An exception was thrown while activating Volo.Abp.BackgroundJobs.BackgroundJobStore. Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Abp.BackgroundJobs.BackgroundJobStore. ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'Volo.Abp.BackgroundJobs.BackgroundJobStore' can be invoked with the available services and parameters: Cannot resolve parameter 'Volo.Abp.BackgroundJobs.IBackgroundJobRepository backgroundJobRepository' of constructor 'Void .ctor(Volo.Abp.BackgroundJobs.IBackgroundJobRepository, Volo.Abp.ObjectMapping.IObjectMapper`1[Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule])'.

See https://autofac.rtfd.io/help/no-constructors-bindable for more info. at Autofac.Core.Activators.Reflection.ReflectionActivator.<>cDisplayClass14_0.b0(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Builder.RegistrationBuilder`3.<>cDisplayClass41_0.b0(ResolveRequestContext context, Action1 next) at Autofac.Builder.RegistrationBuilder3.<>c__DisplayClass39_0.b__0(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.CoreEventMiddleware.Execute(ResolveRequestContext context, Action1 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, Action1 next) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest& request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest& request) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Volo.Abp.BackgroundJobs.BackgroundJobWorker.DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) at Volo.Abp.BackgroundJobs.BackgroundJobWorker.DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) at Volo.Abp.BackgroundWorkers.AsyncPeriodicBackgroundWorkerBase.DoWorkAsync(CancellationToken cancellationToken) 2024-09-05 17:53:19.067 +03:00 [ERR] ---------- Exception Data ---------- ActivatorChain = Volo.Abp.BackgroundJobs.BackgroundJobStore same error .. abp 8.2.0

@maliming @nayanranjane

maliming commented 1 month ago

hi @CodeOutput

Please create a new issue and share the details.

Thanks