We are seeing the error below in our devtools console when attempting to create a new Tenant:
We looked at the source and the error suggests that this.connectionStringsRef (on line 1126) is undefined:
We looked at the source of tenants.component.ts to see how connectionStringsRef was declared:
Further up in that tenants.component.ts file, we noticed the reference to that component:
Later on in the very same tenants.component.ts file, we saw this:
We had to replace that ConnectStringsComponent file. Our changes (in the new replacement component) showed up just fine in the browser. We followed the instructions in the official ABP.io docs, as seen in our modifications to app.component.ts below:
We tried calling this.replaceable.components.add in both the constructor and in ngOnInit (in AppComponent). It made no difference. We still ended up with the same error.
Below is the screen shot of how we added our new replaced component in AppModule, per instructions in the docs:
So, the question is, did we miss something? We did not modify tenants.component.ts; we didn't think we needed to, since we followed the instructions in the docs. So how is tenants.component.ts supposed to know to use the "new-connection-strings.component.ts" file instead of the old "connection-strings.component.ts" file?
Or are we supposed to modify tenants.component.ts as well? If so, does that mean every component that refers to a "replaced" component, somewhere in the dependency tree, needs to be updated?
Please advise, as we are blocked by this.
Thanks!
I've implemented microservice to microservice synchronous communication as stated here. The soulution works just fine. I'm able to get data from cross service but every time I hit the endpoint on other service I see a new token is generated and it is causing my OpenIddictTokens just keeps increasing. Can't the once generated token be re-used again for next service call? I see the token is generated with 1 hour of expiration but next service call(Same endpoint) does not consider existing token and generates the new token.
Thanks Krishna
ABP Framework version: v8.2.x
UI Type: Angular
Database System: EF Core (MySQL)
Auth Server Separated (for Angular): yes
Exception message and full stack trace:
[16:57:31 INF] You are running the second generation of the ABP CLI. If you're interested in the legacy CLI, see https://abp.io/new-cli
[16:57:31 INF] Downloading source code of Volo.Abp.LeptonXTheme (Latest)
[16:57:31 INF] Output folder: /Users/lsuh/Projects/temp/abp
[16:57:49 ERR] Downloading source code failed for: Volo.Abp.LeptonXTheme
Volo.Abp.Studio.AbpStudioException: Exception of type
'Volo.Abp.Studio.AbpStudioException' was thrown.
at async Task Volo.Abp.Studio.Modules.Installing.SourceCodeDownloader.
DownloadSourceCodeAsync(string moduleName, string targetFolder, string
version, bool includeNightly)
at async Task Volo.Abp.Studio.Cli.Commands.StudioGetSourceCommand.ExecuteAsync(
CommandLineArgs commandLineArgs)
at async Task Volo.Abp.Studio.Cli.StudioCliService.RunInternalAsync(
CommandLineArgs commandLineArgs)
at async Task Volo.Abp.Studio.Cli.StudioCliService.RunAsync(string[] args)
Steps to reproduce the issue: Run the following command: abp get-source Volo.Abp.LeptonXTheme
Hi,
I've created an microservices application using ABP Studio and started all services/gateway/authserver and Angular application. I see the databases for each service is created when I browse and login to Angular application I do not see the multiple menu items like Auditing/OpenIddict/Saas on the menu list. After digging some more I see that in my Administration service database does not contains any permissions groups and permissions.
Even my own microservices permissions groups and permissions are not added.
Thanks Krishna
1 next) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action
1 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.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.Entity
public class Vendors : Entity<int>, ICreationAuditedObject
{
[MaxLength(128)]
public string Name { get; set; }
public DateTime CreationTime { get; set; }
public Guid? CreatorId { get; set; }
internal Vendors(string name)
{
Name= name;
CreationTime = DateTime.Now;
CreatorId = Guid.NewGuid();
}
}
App Service
public class VendorAppService : VendorManagementAppService, IVendorManagementAppService
{
private readonly VendorManager _vendorManager;
private readonly IRepository<Vendors, int> _vendorRepository;
public VendorAppService(VendorManager vendorManager, IRepository<Vendors, int> vendorRepository)
{
_vendorManager = vendorManager;
_vendorRepository = vendorRepository;
ObjectMapperContext = typeof(VendorManagementApplicationModule);
}
[Authorize(VendorManagementPermissions.Vendors.Create)]
public async Task<VendorDto> CreateAsync(VendorDto vendor)
{
var vendor1 = await _vendorManager.CreateAsync(
vendor.Name
);
return ObjectMapper.Map<Vendors, VendorDto>(vendor1);
}
[Authorize(VendorManagementPermissions.Vendors.Delete)]
public async Task DeleteAsync(int id)
{
await _vendorRepository.DeleteAsync(id);
}
public async Task<ListResultDto<VendorDto>> GetAllAsync()
{
var vendors = await _vendorRepository.GetListAsync();
return new ListResultDto<VendorDto>(
ObjectMapper.Map<List<Vendors>, List<VendorDto>>(vendors)
);
}
public async Task<VendorDto> GetAsync(int id)
{
return ObjectMapper.Map<Vendors, VendorDto>(await _vendorRepository.GetAsync(id));
}
[Authorize(VendorManagementPermissions.Vendors.Create)]
public async Task<VendorDto> UpdateAsync(VendorDto input)
{
var vendor = await _vendorRepository.GetAsync(input.Id);
vendor.Name = input.Name;
await _vendorRepository.UpdateAsync(vendor);
return ObjectMapper.Map<Vendors, VendorDto>(vendor);
}
}
Controller
[Area(VendorManagementRemoteServiceConsts.ModuleName)]
[RemoteService(Name = VendorManagementRemoteServiceConsts.RemoteServiceName)]
public class VendorController : IVendorManagementAppService
{
private readonly IVendorManagementAppService _vendorManagementAppService;
public VendorController(IVendorManagementAppService vendorManagementAppService)
{
_vendorManagementAppService = vendorManagementAppService;
}
[Authorize]
public Task<VendorDto> CreateAsync(VendorDto vendor)
{
return _vendorManagementAppService.CreateAsync(vendor);
}
[Authorize]
public Task DeleteAsync(int id)
{
return _vendorManagementAppService.DeleteAsync(id);
}
public Task<VendorDto> GetAsync(int id)
{
return _vendorManagementAppService.GetAsync(id);
}
[Authorize]
public Task<ListResultDto<VendorDto>> GetAllAsync()
{
return _vendorManagementAppService.GetAllAsync();
}
[Authorize]
public Task<VendorDto> UpdateAsync(VendorDto vendor)
{
return _vendorManagementAppService.UpdateAsync(vendor);
}
}
Module configuration to include the repositories
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<VendorManagementDbContext>(options =>
{
options.AddDefaultRepositories(includeAllEntities: true);
});
}
Above all code is written in DDD module and reference through the micro-service. Is there anything that I'm missing?
[Table("venclass")]
public class Venclass : AggregateRoot<int>, IMultiTenant
{
public Venclass()
{
}
public Venclass(string classcode, string description, string user_entered)
{
this.class_code = classcode;
this.description = description;
this.date_entered = DateTime.Now;
this.time_entered = DateTime.Now;
this.user_entered = user_entered;
}
[Column("oid")]
public override int Id { get; protected set; }
[Column(TypeName = "varchar(4)" + CollationConst.collation)]
[StringLength(VenclassConsts.Maxclass_codeLength, MinimumLength = VenclassConsts.Minclass_codeLength)]
public virtual string class_code { get; set; }
[Column(TypeName = "varchar(30)" + CollationConst.collation)]
[StringLength(VenclassConsts.MaxdescriptionLength, MinimumLength = VenclassConsts.MindescriptionLength)]
public virtual string description { get; set; }
[DataType(DataType.Date)]
[Column(TypeName = "Date")]
public virtual DateTime? date_entered { get; set; }
[Column(TypeName = "datetime")]
public virtual DateTime? time_entered { get; set; }
[Column(TypeName = "varchar(32)" + CollationConst.collation)]
[StringLength(VenclassConsts.Maxuser_enteredLength, MinimumLength = VenclassConsts.Minuser_enteredLength)]
public virtual string user_entered { get; set; }
[Column("tenant_id")]
public virtual Guid? TenantId { get; }
}
[Authorize(VendorManagementPermissions.VendorClass.Default)]
public class VenClassAppService : VendorManagementAppService, IVenClassAppService
{
private readonly VenClassManager _vendorClassManager;
private readonly IRepository<Venclass, int> _vendorClassRepository;
public VenClassAppService(VenClassManager vendorClassManager, IRepository<Venclass, int> vendorClassRepository)
{
_vendorClassManager = vendorClassManager;
_vendorClassRepository = vendorClassRepository;
}
[Authorize(VendorManagementPermissions.VendorClass.Create)]
public async Task<VenclassDto> CreateAsync(VenclassDto input)
{
var venclass = await _vendorClassManager.CreateAsync(
input.class_code,
input.description,
input.user_entered
);
return ObjectMapper.Map<Venclass, VenclassDto>(venclass,input);
}
[Authorize(VendorManagementPermissions.VendorClass.Delete)]
public async Task DeleteAsync(int id)
{
await _vendorClassRepository.DeleteAsync(id);
}
[Authorize(VendorManagementPermissions.VendorClass.Default)]
public async Task<ListResultDto<VenclassDto>> GetAllAsync()
{
var venclass = await _vendorClassRepository.GetListAsync();
return new ListResultDto<VenclassDto>(
ObjectMapper.Map<List<Venclass>, List<VenclassDto>>(venclass)
);
}
[Authorize(VendorManagementPermissions.VendorClass.Default)]
public async Task<VenclassDto> GetAsync(int id)
{
return ObjectMapper.Map<Venclass, VenclassDto>(await _vendorClassRepository.GetAsync(id));
}
[Authorize(VendorManagementPermissions.VendorClass.Update)]
public async Task<VenclassDto> UpdateAsync(VenclassDto input)
{
var venclass = await _vendorClassRepository.GetAsync(input.Id);
ObjectMapper.Map(input, venclass);
await _vendorClassRepository.UpdateAsync(venclass);
return ObjectMapper.Map<Venclass, VenclassDto>(venclass);
}
}
Module configuration
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<VendorManagementApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<VendorManagementApplicationModule>(validate: true);
});
Configure<AbpMultiTenancyOptions>(options =>
{
options.IsEnabled = true;
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseMultiTenancy();
}
After runnig my app service create function TenantId is stored as null. Am I missing anything?