Hi, after update to version 6.8.0 i got the error “IllegalStateException: Cannot get unfetched attribute [name] from detached object com.company.caerp.entity.Prospecto-5f010284-5a87-922e-2071-759376d9a6d0 [detached].” when open entity browser. The value its correctly saved into database record, and all was working before update, the attribute that cuase the error (Name) is inherited from parent entity and at design time is visible in the IDE, but at run time it fail to read value. thanks!!.-
Hi,
I tried to reproduce the problem, but it works. Could you provide sample project with the error?
Hi, i made a project from scratch to reproduce the error and its works fine too, so let me check why the old project stopped working. i will tell you if something its wrong or not. thanks!!.
Could you check the view for com.company.caerp.entity.Prospecto? It’s possible that view doesn’t contain name property.
I’m experiencing the exact same problem. After updating to 6.8 views that previously worked are now failing with the mentioned IllegalStateException error. My initial find is for association and composition types, where the view inherits from _local, those fields are not fetched. If I explicitly choose each of the fields from the _local view then all is good. This clearly is not a solution but a clue as to the source of the problem. This topic seems to have stalled and was curious if a solution was found.
Hi, i can’t get it working, as i known everything worked before updating to 6.8 version… i can send you project code if you give me an email. I can´t find error.
Entity “Tercero”
Entity “Prospecto”
View properties.
Browse screen.
Error LOG:
java.lang.IllegalStateException: Cannot get unfetched attribute [nombre] from detached object com.company.caerp.entity.Prospecto-d467f977-6aa7-1d8b-b92c-936088aa87eb [detached].
at org.eclipse.persistence.internal.queries.EntityFetchGroup.onUnfetchedAttribute(EntityFetchGroup.java:98)
at com.haulmont.cuba.core.sys.persistence.CubaEntityFetchGroup.onUnfetchedAttribute(CubaEntityFetchGroup.java:61)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.processUnfetchedAttribute(EntityManagerImpl.java:2846)
at com.haulmont.chile.core.model.impl.AbstractInstance._persistence_checkFetched(AbstractInstance.java)
at com.company.caerp.entity.Tercero._persistence_get_nombre(Tercero.java)
at com.company.caerp.entity.Tercero.getNombre(Tercero.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.haulmont.chile.core.model.utils.MethodsCache.invokeGetter(MethodsCache.java:72)
at com.haulmont.chile.core.model.impl.AbstractInstance.getValue(AbstractInstance.java:102)
at com.haulmont.cuba.core.entity.BaseGenericIdEntity.getValue(BaseGenericIdEntity.java:139)
at com.haulmont.chile.core.model.utils.InstanceUtils.getValueEx(InstanceUtils.java:139)
at com.haulmont.cuba.web.gui.data.PropertyWrapper.getValue(PropertyWrapper.java:76)
at com.haulmont.cuba.web.gui.components.WebAbstractTable$TablePropertyWrapper.getValue(WebAbstractTable.java:2035)
at com.haulmont.cuba.web.gui.data.PropertyWrapper.getFormattedValue(PropertyWrapper.java:149)
at com.haulmont.cuba.web.gui.components.WebAbstractTable$TablePropertyWrapper.getFormattedValue(WebAbstractTable.java:2021)
at com.haulmont.cuba.web.toolkit.ui.CubaGroupTable.formatPropertyValue(CubaGroupTable.java:61)
at com.haulmont.cuba.web.toolkit.ui.CubaTable.getPropertyValue(CubaTable.java:200)
at com.vaadin.ui.Table.parseItemIdToCells(Table.java:2387)
at com.vaadin.ui.Table.getVisibleCellsNoCache(Table.java:2237)
at com.vaadin.ui.Table.refreshRenderedCells(Table.java:1780)
at com.vaadin.ui.Table.refreshRowCache(Table.java:2687)
at com.vaadin.ui.Table.containerItemSetChange(Table.java:4616)
at com.vaadin.data.util.ContainerOrderedWrapper$PiggybackListener.containerItemSetChange(ContainerOrderedWrapper.java:706)
at com.haulmont.cuba.web.gui.data.CollectionDsWrapper.fireItemSetChanged(CollectionDsWrapper.java:109)
at com.haulmont.cuba.web.gui.data.CollectionDsWrapper$ContainerDatasourceCollectionChangeListener.collectionChanged(CollectionDsWrapper.java:270)
at com.haulmont.cuba.web.gui.components.WebGroupTable$GroupTableDsWrapper$3.collectionChanged(WebGroupTable.java:785)
at com.haulmont.bali.events.EventRouter.fireEvent(EventRouter.java:45)
at com.haulmont.cuba.gui.data.impl.CollectionDsListenersWrapper.collectionChanged(CollectionDsListenersWrapper.java:53)
at com.haulmont.cuba.web.gui.components.WebAbstractTable$TableCollectionDsListenersWrapper.collectionChanged(WebAbstractTable.java:3028)
at com.haulmont.cuba.gui.data.impl.WeakCollectionChangeListener.collectionChanged(WeakCollectionChangeListener.java:41)
at com.haulmont.bali.events.EventRouter.fireEvent(EventRouter.java:45)
at com.haulmont.cuba.gui.data.impl.AbstractCollectionDatasource.fireCollectionChanged(AbstractCollectionDatasource.java:371)
at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.afterRefresh(CollectionDatasourceImpl.java:198)
at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refresh(CollectionDatasourceImpl.java:163)
at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refresh(CollectionDatasourceImpl.java:119)
at com.haulmont.cuba.gui.data.impl.GroupDatasourceImpl.setSuspended(GroupDatasourceImpl.java:191)
at com.haulmont.cuba.gui.data.impl.DsContextImpl.resumeSuspended(DsContextImpl.java:84)
at com.haulmont.cuba.gui.WindowManager.afterShowWindow(WindowManager.java:1159)
at com.haulmont.cuba.web.WebWindowManager.showWindow(WebWindowManager.java:419)
at com.haulmont.cuba.gui.WindowManager.openWindow(WindowManager.java:756)
at com.haulmont.cuba.web.WebWindowManager.openWindow(WebWindowManager.java:155)
at com.haulmont.cuba.gui.config.MenuCommand$ScreenCommand.run(MenuCommand.java:181)
at com.haulmont.cuba.gui.config.MenuCommand.execute(MenuCommand.java:76)
at com.haulmont.cuba.web.sys.MenuBuilder.lambda$createMenuBarCommand$0(MenuBuilder.java:176)
at com.haulmont.cuba.web.gui.components.mainwindow.WebAppMenu$MenuItemImpl.lambda$setCommand$2434f46b$1(WebAppMenu.java:338)
at com.vaadin.ui.MenuBar.changeVariables(MenuBar.java:212)
at com.vaadin.server.communication.ServerRpcHandler.changeVariables(ServerRpcHandler.java:623)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:470)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:413)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:274)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:90)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1435)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:361)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:300)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:191)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107)
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
I spent most of the day stepping through my code and found the _local view metaproperties for my extended entities were failing at MetadataTools.isPersistent() – returned false for all properties contained in the base entity. My _local view consequently was missing fields from the base entity resulting in the unfetched attribute error. Found this bug “PL-10324 MetadataTools.isPersistent returns false for id attribute” in YouTrack. The issue was fixed and is currently available in the snapshot release. To confirm I switched to snapshot and the problem went away.
ok, i’ll check it. thanks david!!.
ok, i recently update to 6.8.1 and the problem disappear. thanks!!.
This worked for me, writing the attribute as a property in the extension of the view, so when you edit a record the error you had will not appear because the field did not exist in the query.
<view extends="_local">
<property name="tercero" view="_local">
<property name="nombre"/>
</property>