java.lang.IllegalStateException: Cannot get unfetched attribute [smrMontagePlace] from detached object com.company.enerstroymain.entity.contracts.stolbi.StolbiAccountingPoint-14357cb1-806d-2ee4-d052-fb48ce0d3bff [detached].
at org.eclipse.persistence.internal.queries.EntityFetchGroup.onUnfetchedAttribute(EntityFetchGroup.java:100)
at com.haulmont.cuba.core.sys.persistence.CubaEntityFetchGroup.onUnfetchedAttribute(CubaEntityFetchGroup.java:74)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.processUnfetchedAttribute(EntityManagerImpl.java:2998)
at com.haulmont.chile.core.model.impl.AbstractInstance._persistence_checkFetched(AbstractInstance.java)
at com.company.enerstroymain.entity.AccountingPoint._persistence_get_smrMontagePlace(AccountingPoint.java)
at com.company.enerstroymain.entity.AccountingPoint.getSmrMontagePlace(AccountingPoint.java:575)
at com.company.enerstroymain.entity.AccountingPoint.setSmrMontagePlace(AccountingPoint.java)
at com.company.enerstroymain.service.importfile.ImportDataServiceBean.lambda$importStolbiFizNew$13(ImportDataServiceBean.java:1282)
at com.company.enerstroymain.service.importfile.ImportDataServiceBean$FileInputDescriptor.prepareRowAction(ImportDataServiceBean.java:175)
at com.company.enerstroymain.service.importfile.ImportDataServiceBean.parseFile(ImportDataServiceBean.java:403)
at com.company.enerstroymain.service.importfile.ImportDataServiceBean.importStolbiFizNew(ImportDataServiceBean.java:1345)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy349.importStolbiFizNew(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:94)
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:154)
at com.sun.proxy.$Proxy94.importStolbiFizNew(Unknown Source)
at com.company.enerstroymain.web.services.inside.dataimport.Dataupload$5.run(Dataupload.java:532)
at com.company.enerstroymain.web.services.inside.dataimport.Dataupload$5.run(Dataupload.java:529)
at com.haulmont.cuba.gui.backgroundwork.LocalizedTaskWrapper.run(LocalizedTaskWrapper.java:57)
at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.call(WebBackgroundWorker.java:205)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.lambda$startExecution$1(WebBackgroundWorker.java:376)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Добрый день! Вылетает такая ошибка, во view данный атрибут указан. В дебаге метод getSmrMontagePlace() возвращает значение но в процессе выполнения класса я вызываю dataManager.load(MontagePlaceEnum.class).query(select mp from enerstroymain$MontagePlaceEnum mp where …).one();
эта строчка возвращает сущность но после ее выполнения метод getSmrMontagePlace() приводит к ошибке трейс которой я скинул.
Подскажите, пожалуйста, как это можно решить. Спасибо.