IllegalStateException: Cannot get unfetched attribute

Hi Cuba Support Team,

I’m in a weird situation where I get the below error only in other servers (QA & PRODUCTION) not in my development computer. And I get this error while adding new

Cuba version is 6.9.7 and I use Postgresql as DB.

Kindly help.

Thanks,
Hari

Hi,

IllegalStateException: Cannot get unfetched attribute is a typical error that occurs when you try to access an entity attribute not loaded from the database. The set of loaded attributes is defined by a view.

By taking look at exception stack trace and the source code of affected screen, Spring bean or classes you can figure out which views need to be extended.

You can read more about CUBA views and “unfetched attribute” solving in this article: Views - the uncharted mystery – Road to CUBA and beyond...

The most likely reason why you get error only on QA/production - is the difference in data. That is, the error reproduces only for some combinations of entity relations.

Thanks, I got it fixed by altering views.