Error studio v13 plugin IntelliJ Ultimate 2019.3.3

When creating a new entity, this error is generated in IntelliJ Ultimate 2019.3.3 Build 193.6494.35

java.lang.IllegalStateException
	at com.haulmont.studio.backend.model.EntityPsi.getPsiClass(EntityPsi.java:387)
	at com.haulmont.studio.backend.model.EntityPsi.lambda$isPersistentEntity$3(EntityPsi.java:91)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:807)
	at com.haulmont.studio.backend.util.MetadataUtil.ra(MetadataUtil.java:961)
	at com.haulmont.studio.backend.model.EntityPsi.isPersistentEntity(EntityPsi.java:91)
	at com.haulmont.studio.intellij.ui.entity.attr.AttributePropertiesPanel.lambda$getEntityTypes$14(AttributePropertiesPanel.java:1298)
	at com.haulmont.studio.intellij.ui.menu.CacheHolder.getValue(CacheHolder.kt:28)
	at com.haulmont.studio.intellij.ui.entity.attr.AttributePropertiesPanel.getEntityTypes(AttributePropertiesPanel.java:1292)
	at com.haulmont.studio.intellij.ui.entity.attr.AttributePropertiesPanel.loadTypes(AttributePropertiesPanel.java:1257)
	at com.haulmont.studio.intellij.ui.entity.attr.AttributePropertiesPanel.access$3800(AttributePropertiesPanel.java:105)
	at com.haulmont.studio.intellij.ui.entity.attr.AttributePropertiesPanel$AttributeFormFieldFactory.createComponent(AttributePropertiesPanel.java:1423)
	at com.haulmont.studio.intellij.ui.propertyform.AbstractPropertyForm.addFormField(AbstractPropertyForm.java:112)
	at com.haulmont.studio.intellij.ui.propertyform.AbstractPropertyForm.setBeanDataSource(AbstractPropertyForm.java:91)
	at com.haulmont.studio.intellij.ui.entity.attr.AttributePropertiesPanel.<init>(AttributePropertiesPanel.java:203)
	at com.haulmont.studio.intellij.ui.entity.EntityPropertiesPanel.lambda$createAttributesLayout$1(EntityPropertiesPanel.java:272)
	at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:219)
	at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:199)
	at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:246)
	at java.desktop/javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:443)
	at java.desktop/javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:453)
	at java.desktop/javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:497)
	at java.desktop/javax.swing.JTable.setRowSelectionInterval(JTable.java:2173)
	at com.haulmont.studio.intellij.ui.entity.EntityPropertiesPanel.addAttribute(EntityPropertiesPanel.java:543)
	at com.haulmont.studio.intellij.ui.entity.EntityPropertiesPanel.addNewAttribute(EntityPropertiesPanel.java:528)
	at com.haulmont.studio.intellij.ui.entity.EntityPropertiesPanel.lambda$createAttributesLayout$3(EntityPropertiesPanel.java:329)
	at com.intellij.ui.ToolbarDecorator$2.doAdd(ToolbarDecorator.java:427)
	at com.intellij.ui.CommonActionsPanel$Buttons.performAction(CommonActionsPanel.java:57)
	at com.intellij.ui.CommonActionsPanel$MyActionButton.actionPerformed(CommonActionsPanel.java:252)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:298)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:315)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:289)
	at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:194)
	at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:157)
	at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:447)
	at java.desktop/java.awt.Component.processEvent(Component.java:6416)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:846)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:778)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Regards,

Nelson F.

Hi

Thanks for reporting the issue.

Did you delete any entities before the exception occurred?

Hi @gaslov, yes after that it starts to fail and the new entities created are not stored correctly.

image

After generating the previous error, this is being generated:

java.lang.IllegalStateException
	at com.haulmont.studio.backend.model.EntityPsi.getPsiClass(EntityPsi.java:387)
	at com.haulmont.studio.backend.model.EntityPsi.getName(EntityPsi.java:265)
	at com.haulmont.studio.backend.model.Entity.toString(Entity.java:488)
	at org.apache.commons.lang.ObjectUtils.toString(ObjectUtils.java:272)
	at com.haulmont.studio.intellij.ui.entity.AttributesTableModel.getTypeValue(AttributesTableModel.java:65)
	at com.haulmont.studio.intellij.util.swing.CubaAbstractTableModel$ColumnMetaInfo.getValue(CubaAbstractTableModel.java:330)
	at com.haulmont.studio.intellij.util.swing.CubaAbstractTableModel.getValueAt(CubaAbstractTableModel.java:198)
	at java.desktop/javax.swing.JTable.getValueAt(JTable.java:2706)
	at java.desktop/javax.swing.JTable.prepareRenderer(JTable.java:5721)
	at com.intellij.ui.table.JBTable.prepareRenderer(JBTable.java:558)
	at java.desktop/javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2185)
	at java.desktop/javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:2087)
	at java.desktop/javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1883)
	at java.desktop/javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
	at java.desktop/javax.swing.JComponent.paintComponent(JComponent.java:797)
	at com.intellij.ui.table.JBTable.paintComponent(JBTable.java:314)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1074)
	at com.intellij.ui.table.JBTable.paint(JBTable.java:410)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JViewport.paint(JViewport.java:737)
	at com.intellij.ui.components.JBViewport.paint(JBViewport.java:234)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:590)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at com.intellij.ui.tabs.impl.JBTabsImpl.paintChildren(JBTabsImpl.java:1715)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at com.intellij.ui.tabs.impl.JBTabsImpl.paintChildren(JBTabsImpl.java:1715)
	at com.intellij.openapi.fileEditor.impl.EditorTabbedContainer$EditorTabs.paintChildren(EditorTabbedContainer.java:636)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5255)
	at java.desktop/javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:246)
	at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1333)
	at java.desktop/javax.swing.JComponent._paintImmediately(JComponent.java:5203)
	at java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:5013)
	at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:868)
	at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:851)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:851)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:826)
	at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:775)
	at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1901)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:781)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

There is a bug in Studio.
Error occurred when deleting entity or enum that have references in the entity currently opened in designer. See YouTrack issue
As a workaround you need to close all entity designer instances before deleting entity or enumeration.

The fix will be available in the next Studio release