Please advise if you have any update on this issue.
The container is started and it is running fine but if there is no call made to the api, the TradeFinanceBatchEventHandler doesn't listens to the published messages until the container is restarted. So for any messages which are published by service1, I have to start the container of service 2 every time in order to consume and process those messages successfully. How do i keep my Handler listening continously the published messages. Hope I was able to porvide the needed information. Let me know if you need further details.
Thanks it was fixed.
@yekalkan I tried with steps suggested by you but now getting below error. Also attached are the logs.
`[error] Error: Cannot find module '@angular-devkit/build-angular/package.json' Require stack:
Hi,
Below is the package.json file of Angular project. Note - I referred to following link for migration - https://docs.abp.io/en/abp/latest/UI/Angular/Migration-Guide-v3
{
"name": "Litmus",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --open",
"build": "ng build",
"build:prod": "ng build --configuration production",
"test": "jest",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"jest": {
"preset": "jest-preset-angular",
"setupFilesAfterEnv": [
"<rootDir>/setupJest.ts"
],
"testPathIgnorePatterns": [
"<rootDir>/node_modules/",
"<rootDir>/dist/",
"<rootDir>/src/test.ts"
]
},
"dependencies": {
"@abp/ng.setting-management": "~3.0.4",
"@angular/animations": "~10.0.5",
"@angular/cdk": "^10.1.0",
"@angular/common": "~10.0.5",
"@angular/compiler": "~10.0.5",
"@angular/core": "~10.0.5",
"@angular/forms": "~10.0.5",
"@angular/material": "^10.1.0",
"@angular/platform-browser": "~10.0.5",
"@angular/platform-browser-dynamic": "~10.0.5",
"@angular/router": "~10.0.5",
"@types/jest": "^26.0.0",
"@volo/abp.ng.account": "~3.0.4",
"@volo/abp.ng.audit-logging": "~3.0.4",
"@volo/abp.ng.identity": "~3.0.4",
"@volo/abp.ng.identity-server": "~3.0.4",
"@volo/abp.ng.language-management": "~3.0.4",
"@volo/abp.ng.saas": "~3.0.4",
"@volo/abp.ng.text-template-management": "~3.0.4",
"@volo/abp.ng.theme.lepton": "~3.0.4",
"jest": "^26.0.1",
"jest-preset-angular": "^8.2.1",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.4",
"@angular-devkit/build-ng-packagr": "~0.1000.4",
"@angular/cli": "~10.0.4",
"@angular/compiler-cli": "~10.0.5",
"@angular/language-service": "~10.0.5",
"@ngxs/logger-plugin": "^3.6.2",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"ng-packagr": "^10.0.0",
"ngxs-schematic": "^1.1.9",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.9.7"
},
"resolutions": {
"@abp/ng.core": "~2.7.0",
"@abp/ng.feature-management": "~2.7.0",
"@abp/ng.theme.shared": "~2.7.0",
"@abp/ng.permission-management": "~2.7.0",
"@abp/ng.setting-management.config": "~2.7.0",
"@abp/utils": "~2.7.0",
"@volo/abp.commercial.ng.ui": "~2.7.0",
"@volo/abp.ng.account.config": "~2.7.0",
"@volo/abp.ng.audit-logging.config": "~2.7.0",
"@volo/abp.ng.language-management.config": "~2.7.0",
"@volo/abp.ng.identity-server.config": "~2.7.0",
"@volo/abp.ng.identity.config": "~2.7.0",
"@volo/abp.ng.saas.config": "~2.7.0",
"@volo/abp.ng.text-template-management.config": "~2.7.0"
}
}
Hi,
Please find below code snippet for one of unit test class. Let me know if need further information.
public class SupplierRegistrationServiceTests : ProfileManagementApplicationTestBase
{
private readonly ISupplierRegistrationAppService _supplierRegistrationAppService;
private readonly ISupplierRegistrationRepository _supplierRegistrationRepository;
private readonly ISupplierRepository _supplierRepository;
private readonly ISupplierCodeRepository _supplierCodeRepository;
private readonly IBusinessEntityRepository _businessEntityRepository;
private readonly ISupplierUserProfileRepository _supplierUserProfileRepository;
public SupplierRegistrationServiceTests()
{
_supplierRegistrationAppService = GetRequiredService<ISupplierRegistrationAppService>();
_supplierRegistrationRepository = GetRequiredService<ISupplierRegistrationRepository>();
_supplierRepository = GetRequiredService<ISupplierRepository>();
_supplierCodeRepository = GetRequiredService<ISupplierCodeRepository>();
_businessEntityRepository = GetRequiredService<IBusinessEntityRepository>();
_supplierUserProfileRepository = GetRequiredService<ISupplierUserProfileRepository>();
}
[Fact]
public async Task RegisterAsync()
{
var supplierCodeList = new List<SupplierCodeCreateDto>
{
new SupplierCodeCreateDto
{
Code = "24865",
IsPrimary = true,
SupplierId = Guid.Parse("99255F1D-9A43-4523-A499-96839ABFD423")
},
new SupplierCodeCreateDto
{
Code = "17596",
IsPrimary = false,
SupplierId = Guid.Parse("99255F1D-9A43-4523-A499-96839ABFD423")
}
};
var supplierCreateDto = new SupplierCreateDto
{
Name = "Microsoft",
BusinessEntityId = Guid.Parse("231c8aac-3355-4c8b-84d7-eabb4ceba041"),
SupplierCodes = supplierCodeList
};
var supplierUserProfileCreateDto = new SupplierUserProfileCreateDto
{
FirstName = "Bill",
LastName = "Gate",
Email = "Bill.Gate@yahoo.com",
Designation = "Executive",
PhoneNumber = "99999999",
IsAdmin = false,
IsPrimary = true,
CallingCountryCode = "91",
PhoneType = PhoneType.Mobile
};
var supplierRegistration = new SupplierRegistrationCreateDto
{
FinancingModelId = 1,//Need to change later
TermsAndConditions = true,
TermsAndConditionsTime = DateTime.Now.Date,
Supplier = supplierCreateDto
};
var input = new SupplierRegistrationProcessDto
{
SupplierRegistration = supplierRegistration,
SupplierUserProfile = supplierUserProfileCreateDto
};
// Act
var serviceResult = await _supplierRegistrationAppService.RegisterAsync(input);
// Assert
var result = await _supplierRegistrationRepository.FindAsync(c => c.Id == serviceResult.Id);
result.ShouldNotBe(null);
// Assert
var supplierResult = await _supplierRepository.FindAsync(c => c.Id == result.SupplierId);
supplierResult.ShouldNotBe(null);
supplierResult.Name.ShouldBe("Microsoft");
supplierResult.BusinessEntityId.ShouldBe(Guid.Parse("231c8aac-3355-4c8b-84d7-eabb4ceba041"));
}
Also, below is the error -
SCV.Litmus.ProfileManagement.SupplierRegistrations.SupplierRegistrationServiceTests.RegisterAsync
Source: SupplierRegistrationApplicationTests.cs line 37 Duration: 1 ms
Message:
Autofac.Core.DependencyResolutionException : An exception was thrown while activating Volo.Abp.EntityFrameworkCore.EntityHistory.EntityHistoryHelper -> SCV.Litmus.ProfileManagement.CustomAuditingStore.
---- Autofac.Core.DependencyResolutionException : None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'SCV.Litmus.ProfileManagement.CustomAuditingStore' can be invoked with the available services and parameters:
Cannot resolve parameter 'Volo.Abp.AuditLogging.IAuditLogRepository auditLogRepository' of constructor 'Void .ctor(Volo.Abp.AuditLogging.IAuditLogRepository, Volo.Abp.Guids.IGuidGenerator, Volo.Abp.Uow.IUnitOfWorkManager, Microsoft.Extensions.Options.IOptions1[Volo.Abp.Auditing.AbpAuditingOptions])'. Stack Trace: InstanceLookup.Activate(IEnumerable
1 parameters, Object& decoratorTarget)
InstanceLookup.Execute()
ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable
1 parameters)
ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) AutowiringPropertyInjector.InjectProperties(IComponentContext context, Object instance, IPropertySelector propertySelector, IEnumerable
1 parameters)
<>c__DisplayClass34_0.<PropertiesAutowired>b__1(Object s, ActivatingEventArgs1 e) ComponentRegistration.RaiseActivating(IComponentContext context, IEnumerable
1 parameters, Object& instance)
InstanceLookup.Activate(IEnumerable1 parameters, Object& decoratorTarget) InstanceLookup.Execute() ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters)
ResolveOperation.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters) ResolveOperation.Execute(IComponentRegistration registration, IEnumerable
1 parameters)
LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters) ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1 parameters, Object& instance)
ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable
1 parameters)
ResolutionExtensions.Resolve(IComponentContext context, Type serviceType)
AutofacServiceProvider.GetRequiredService(Type serviceType)
ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
UnitOfWorkDbContextProvider1.CreateDbContextWithTransaction(IUnitOfWork unitOfWork) UnitOfWorkDbContextProvider
1.CreateDbContext(IUnitOfWork unitOfWork)
UnitOfWorkDbContextProvider1.CreateDbContext(IUnitOfWork unitOfWork, String connectionStringName, String connectionString) <>c__DisplayClass3_0.<GetDbContext>b__0() <>c__DisplayClass6_0
2.<GetOrAdd>b__0(TKey k)
AbpDictionaryExtensions.GetOrAdd[TKey,TValue](IDictionary2 dictionary, TKey key, Func
2 factory)
AbpDictionaryExtensions.GetOrAdd[TKey,TValue](IDictionary2 dictionary, TKey key, Func
1 factory)
UnitOfWork.GetOrAddDatabaseApi(String key, Func1 factory) UnitOfWorkDbContextProvider
1.GetDbContext()
EfCoreRepository2.get_DbContext() EfCoreRepository
2.get_DbSet()
EfCoreRepository2.InsertAsync(TEntity entity, Boolean autoSave, CancellationToken cancellationToken) AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync()
UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
SupplierCodeDataSeedContributor.SeedAsync(DataSeedContext context) line 21
DataSeeder.SeedAsync(DataSeedContext context)
AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
CastleAbpMethodInvocationAdapter.ProceedAsync()
UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
<<SeedTestData>b__0>d.MoveNext() line 35
--- End of stack trace from previous location where exception was thrown ---
TaskExtensions.WaitAndUnwrapException(Task task)
<>c__DisplayClass15_0.<Run>b__0(Task t)
ContinuationTaskFromTask.InnerInvoke()
<.cctor>b__274_0(Object obj)
ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
TaskExtensions.WaitAndUnwrapException(Task task)
AsyncContext.Run(Func1 action) AsyncHelper.RunSync(Func
1 action)
ProfileManagementTestBaseModule.SeedTestData(ApplicationInitializationContext context) line 31
ProfileManagementTestBaseModule.OnApplicationInitialization(ApplicationInitializationContext context) line 26
OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module)
ModuleManager.InitializeModules(ApplicationInitializationContext context)
AbpApplicationBase.InitializeModules()
AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider)
AbpIntegratedTest1.ctor() ProfileManagementTestBase
1.ctor()
ProfileManagementApplicationTestBase.ctor()
SupplierRegistrationServiceTests.ctor() line 25
----- Inner Stack Trace -----
ReflectionActivator.GetValidConstructorBindings(IComponentContext context, IEnumerable1 parameters) ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters)
InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
Hi,
Never mind. I was able to resolve it, actually below line was added to both module classes (MyProjectApplicationModule, MyProjectHttpApiHostModule) which was causing the issue -
Configure<AbpVirtualFileSystemOptions>(options => { options.FileSets.AddEmbedded<MyProjectApplicationModule>("MyProject"); });
Thanks for the prompt response and help.
Thanks, could you please let me know how do you want me connect with you? Are you available on teams or Google meet?