Multi-tenancy: no value was provided for the session property [tenantId]

I don’t know what is causing the error in the application, please help me find this issue. :pensive:

    11:23:41.221 ERROR c.h.cuba.core.sys.ServiceInterceptor    - Exception: 
javax.persistence.PersistenceException: Exception [EclipseLink-106] (Eclipse Persistence Services - 2.7.3.14-cuba): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The method [_persistence_set_country_vh] on the object is throwing an exception. 
Argument: [{null}]
Internal Exception: java.lang.reflect.InvocationTargetException
Target Invocation Exception: Exception [EclipseLink-6174] (Eclipse Persistence Services - 2.7.3.14-cuba): org.eclipse.persistence.exceptions.QueryException
Exception Description: No value was provided for the session property [tenantId]. This exception is possible when using additional criteria or tenant discriminator columns without specifying the associated contextual property. These properties must be set through EntityManager, EntityManagerFactory or persistence unit properties. If using native EclipseLink, these properties should be set directly on the session.
Query: ReadObjectQuery(referenceClass=Person sql="SELECT ID, ADDED_FROM, ADDRESS, ADDRESS2, BIRTH_DATE, CHILDREN, CODE, COMPLETED, CREATE_TS, CREATED_BY, DATE_COLLECT_DOCUMENTS, DATE_EMPLOYMENT, DELETE_TS, DELETED_BY, EMAIL, EMPLOYEE_OR_NOT, EXIT_, FILL_DATE, FULL_NAME, ID_NUMBER, INN, LATITUDE, LONGITUDE, MEMO, PERSON_STATUS, PERSON_TYPE, PHONE, PHONE2, REGION_IS_DEFAULT, SALARY_AMOUNT, SCORE, TENANT_ID, UPDATE_TS, UPDATED_BY, VERSION, BRANCH_ID, CATEGORY_ID, COUNTRY_ID, DEPARTMENT_ID, EDUCATION_LEVEL_ID, EXPERIENCE_ID, GENDER_ID, GROUP_ID, LINKED_PERSON_ID, MARITAL_STATUS_ID, OFFERED_POSITION_ID, PHOTO_ID, POSITION_ID, QUESTIONNAIRE_ID, REGION_ID, REQUEST_ID, RESPONSIBLE_ID, SALARY_LEVEL_ID, SOURCE_ID, TG_USER_ID FROM JOBSTER_PERSON WHERE ((ID = ?) AND ((0=0) AND ((? = ?) OR (TENANT_ID = ?))))")
Mapping: org.eclipse.persistence.mappings.ManyToOneMapping[country]
Descriptor: RelationalDescriptor(com.smartbox.jobster.entity.actor.Person --> [DatabaseTable(JOBSTER_PERSON)])
	at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:493) ~[org.eclipse.persistence.jpa-2.7.3-14-cuba.jar:na]
	at com.haulmont.cuba.core.sys.QueryImpl.getResultFromCache(QueryImpl.java:768) ~[cuba-core-7.2.13.jar:7.2.13]
	at com.haulmont.cuba.core.sys.QueryImpl.getResultList(QueryImpl.java:415) ~[cuba-core-7.2.13.jar:7.2.13]
	at com.haulmont.cuba.core.app.RdbmsStore.executeQuery(RdbmsStore.java:901) ~[cuba-core-7.2.13.jar:7.2.13]
	at com.haulmont.cuba.core.app.RdbmsStore.getResultList(RdbmsStore.java:809) ~[cuba-core-7.2.13.jar:7.2.13]
	at com.haulmont.cuba.core.app.RdbmsStore.loadList(RdbmsStore.java:242) ~[cuba-core-7.2.13.jar:7.2.13]
	at jdk.internal.reflect.GeneratedMethodAccessor363.invoke(Unknown Source) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at com.sun.proxy.$Proxy403.loadList(Unknown Source) ~[na:na]
	at com.haulmont.cuba.core.app.DataManagerBean.loadList(DataManagerBean.java:78) ~[cuba-core-7.2.13.jar:7.2.13]
	at com.haulmont.cuba.core.app.DataServiceBean.loadList(DataServiceBean.java:54) ~[cuba-core-7.2.13.jar:7.2.13]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:90) ~[cuba-core-7.2.13.jar:7.2.13]
	at jdk.internal.reflect.GeneratedMethodAccessor241.invoke(Unknown Source) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
1 Like

Cuba version 7.2.12
openjdk version “11.0.10”