org.grails.datastore.mapping.multitenancy.exceptions.TenantNotFoundException: Tenant could not be resolved outside a web request

GitHub | goeh | 3 months ago
  1. 0

    Nested Tenants.withId() calls clears current tenant

    GitHub | 3 months ago | goeh
    org.grails.datastore.mapping.multitenancy.exceptions.TenantNotFoundException: Tenant could not be resolved outside a web request

    Root Cause Analysis

    1. org.grails.datastore.mapping.multitenancy.exceptions.TenantNotFoundException

      Tenant could not be resolved outside a web request

      at org.grails.datastore.mapping.multitenancy.web.SessionTenantResolver.resolveTenantIdentifier()
    2. org.grails.datastore
      SessionTenantResolver.resolveTenantIdentifier
      1. org.grails.datastore.mapping.multitenancy.web.SessionTenantResolver.resolveTenantIdentifier(SessionTenantResolver.groovy:39)
      1 frame
    3. grails.gorm.multitenancy
      Tenants.currentId
      1. grails.gorm.multitenancy.Tenants.currentId(Tenants.groovy:58)
      1 frame
    4. current.tenant.issue
      Person.beforeValidate
      1. current.tenant.issue.Person.beforeValidate(Person.groovy:27)
      1 frame
    5. Spring Core
      ReflectionUtils.invokeMethod
      1. org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:216)
      1 frame
    6. Grails GORM
      BeforeValidateHelper$BeforeValidateEventTriggerCaller.call
      1. org.grails.datastore.gorm.support.EventTriggerCaller$MethodCaller.call(EventTriggerCaller.java:147)
      2. org.grails.datastore.gorm.support.EventTriggerCaller.call(EventTriggerCaller.java:90)
      3. org.grails.datastore.gorm.support.BeforeValidateHelper$BeforeValidateEventTriggerCaller.call(BeforeValidateHelper.java:44)
      3 frames
    7. Grails GORM
      EventTriggeringInterceptor.onPersistenceEvent
      1. org.grails.orm.hibernate.support.ClosureEventListener.onValidate(ClosureEventListener.java:383)
      2. org.grails.orm.hibernate.EventTriggeringInterceptor.onValidate(EventTriggeringInterceptor.java:181)
      3. org.grails.orm.hibernate.EventTriggeringInterceptor.onPersistenceEvent(EventTriggeringInterceptor.java:92)
      3 frames
    8. Grails GORM
      AbstractPersistenceEventListener.onApplicationEvent
      1. org.grails.datastore.mapping.engine.event.AbstractPersistenceEventListener.onApplicationEvent(AbstractPersistenceEventListener.java:51)
      1 frame
    9. Spring Context
      AbstractApplicationContext.publishEvent
      1. org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166)
      2. org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
      3. org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:382)
      4. org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:336)
      4 frames
    10. Grails GORM
      ConfigurableApplicationContextEventPublisher.publishEvent
      1. org.grails.datastore.gorm.events.ConfigurableApplicationContextEventPublisher.publishEvent(ConfigurableApplicationContextEventPublisher.groovy:30)
      1 frame
    11. Grails GORM
      AbstractHibernateGormInstanceApi.save
      1. org.grails.orm.hibernate.AbstractHibernateGormInstanceApi.save(AbstractHibernateGormInstanceApi.groovy:114)
      1 frame
    12. Grails GORM
      GormEntity$Trait$Helper.save
      1. org.grails.datastore.gorm.GormEntity$Trait$Helper.save(GormEntity.groovy:151)
      1 frame
    13. current.tenant.issue
      PersonHandler.createWithCar_closure2
      1. current.tenant.issue.PersonHandler.createWithCar_closure2(PersonHandler.groovy:29)
      1 frame