Jmix version: 2.8.1
Jmix Studio plugin version: 2.8.1-261
IntelliJ IDEA 2026.1.2
Build #IU-261.24374.151, built on May 14, 2026
Source revision: fa0cfa150836c
Runtime version: 25.0.2+10-b329.117 x86_64137.0.17-261-b81
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
Operating System: macOS 26.4.1 (25E253)
Exception reporter ID: 130125217606a47-a271-49c2-abca-7694492439bf
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Metal Rendering is ON
Kotlin: 261.24374.151-IJ
File System: Case-Sensitive Journaled HFS+ (APFS)
Browser: Safari - Version 26.4 (21624.1.16.11.4)
Database: PostgreSQL 13
Hello Everyone
For your information, I am receiving a “Cannot get unfetched attribute from detached object” exception even though my “Contact” entity and all of its attributes, ASSOCIATIONS, COMPOSITIONS, and their attributes are included in the Fetch Plan.
This occurs within the dialogWindows.detail().build() method of an open “Performance” entity detail view before the dialogWindows’ open() method is called to display the “Contact” entity in its own dialog. The exception is thrown because the gigType COMPOSITION of the Performance ASSOCIATION attribute of the “Contact” entity is not available (= null). But it is non-null when calling the build() method. It is actually displayed in the “Performance” entity’s open detail view before calling build(). The “Contact” entity itself is NEW and created in the createContact() function just before the build() method is called…
contact = metadata.create(Contact.class);
contact.setReason(informationTextArea.getValue());
contact.setSearch(perfSearch);
contact.setSearchRevision(perfSearch.getRevision());
contact.setInterest(null);
contact.setPerformance(getEditedEntity()); // Detached “Performance” entity with a non-null gigType COMPOSITION
I have extended the Contact entity _base Fetch Plan by manually adding all of the ASSOCIATION and COMPOSITION references (and set them to _base and added all of their attributes), and during my multiple attempts to resolve this problem, I have recursively added the entity (everything) many times. When I manually step into the build() method, and through the other internal code, the number of times I see the entity and the gigType COMPOSITION attribute is increased after having added the recursive references, but at some point I still receive the exception.
I see the gigType COMPOSITION multiple times when it passes through this getValue() method (EntityValues.java line 100) and its value is non-null for almost all of these calls until at some point it is null and the exception is thrown.
public static T getValue(Object entity, String name) {
return getEntityEntry(entity).getAttributeValue(name);
}
When I say “almost all of these calls”, I mean that I have seen a gigType = null value, that did not throw an exception, as well as a Performance = null value, that did not throw an exception, but these attributes had non-null values during the next iterations while stepping, and I stepped through this method, and saw a non-null gigType values at least 20 times over a 50 minute period, while recursively traversing my latest Fetch Plan a few days ago. Here you see some examples that prove that the gigType value is available (non-null) when entering the build() method and during the majority of the calls to EntityValues.java’s getValue() method (above).
Here is a null value for the gigType COMPOSITION without an exception…
Here is a null value for the Performance ASSOCIATION without an exception…
Furthermore, I set a breakpoint at setGigType() in its Performance entity’s class and it is never called; therefore, gigType is not overwritten within the build() method.
Here is the example of another attempt (different Performance entity ID), where you see the non-null value in the getValue() method, but the next time it is called the value is null, and the exception occurs.
An now the exception is thrown…
I have also tried to find the source of the problem by disabling lazy loading with jmix.eclipselink.disable-lazy-loading = true but I was unsuccessful. I have also tried to use fetch=“JOIN” instead of the AUTO setting in the Fetch Plan without any resolution. I have set other breakpoints, but much of the code is very abstract and sparsely documented, so was not yet able to determine where gigType is set to null.
My entity structure is very complex, so I am certain that I cannot provide a demo project to show how to reproduce this; therefore, I need some specific advice about what else I need to look for and where. I can single step through the code for weeks, but a few suggestions would certainly help. I am convinced that this is a bug; the gigType ASSOCIATION is non-null when the detached Performance entity enters the build() method, and if it is physically fetched again, then the gigType ASSOCIATION and its attributes should also be fetched.
Furthermore, it would be helpful to have detailed fetch plan examples for entities with nested ASSOCIATIONS and COMPOSITIONS, e.g. Many-to-Many relationship, so that it is explicilty clear when to stop the fetch plan recursion; it should be obvious, but it is not when this type of problem occurs.
Thank you in advance for your feedback and support.
Best regards
Chris











