User can't be extended if multi tenancy addon is used

If user is extended using tenantuser, project does not run at all. (If I remove multitenancy addon, it works fine)

Thanks

Hi @umeshhodwala , will the same thing happen to me?

Hi Nelson,

I think you are getting problem in next stage but i am getting problem just after creating new entity ExtUser extending tenantuser. (still not extended screens).If i run the project, I get error “unexpected error, please contact system administrator” and no login window is shown.

Are you able to extend tenanatuser entity?

What version of Cuba and Multitenant are you using?

cuba 7.0.6 and multi tenancy 1.3.2

Hi @umeshhodwala,

Please provide a demo application where this issue can be replicated.

Regards,
Evgeny

Remove ExtUser and ExtGroup by default both entities are already extended within the component. It’s a failure in the help that should be reported.

Thanks @nelsonflorez ,
I didn’t get your point. Please elaborate.

sample app with just one entity complex and another entity ExtUser.
I have removed deployment folder due to size limitation.

demo.7z (145.0 KB)

Hi @umeshhodwala,

For your extended entity, you need to update DTYPE column. Please add following SQL to your init and update DB scripts:

update SEC_USER set DTYPE = 'demo_ExtUser'^

Regards,
Evgeny

This doesn’t help. Same problem continues - project doesn’t run.

The problem get solved by using extended entity name BizUser or anyother but not ExtUser (If entity name is ExtUser the problem persist) and then using "update SEC_USER set DTYPE = ‘demo_BizUser’^

But now I am getting another problem in extending screen. If extended user entity has any association then browse/edit screen will give “IllegalStateException: Cannot get unfetched attribute [complex] from detached object com.company.demo.entity.BizUser-9452f622-958f-e79d-1942-c261dc03e9ae [detached]” error. In view the complex association is _local as can be seen from image.
cubabiz

For browser screen this problem was solved by changing the Ds class from Sec$User to BizUser, but as edit screen have NPE issue as mentioned by @nelsonflorez, This can’t be solved.

How can I solve this issue.

Hi,

Please provide me full NPE error from the log.

Regards,
Evgeny

This is already reported by @nelsonflorez and included in track issue https://youtrack.cuba-platform.com/issue/STUDIO-6214.

java.lang.RuntimeException: java.lang.NullPointerException
at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.lambda$activate$7(SourceFile:402)
at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:53)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:973)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
at com.intellij.openapi.application.ReadAction.run(ReadAction.java:53)
at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.activate(SourceFile:369)
at com.haulmont.studio.intellij.ui.sd.ScreenDesignerEditor.lambda$activatePanel$0(SourceFile:69)
at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:53)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:973)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
at com.intellij.openapi.application.ReadAction.run(ReadAction.java:53)
at com.haulmont.studio.intellij.ui.sd.ScreenDesignerEditor.activatePanel(SourceFile:58)
at com.haulmont.studio.intellij.ui.sd.ScreenDesignerEditor.activatePanel(SourceFile:18)
at com.haulmont.studio.intellij.ui.AbstractVaadinEditor.lambda$selectNotify$2(SourceFile:78)
at com.vaadin.ui.UI.accessSynchronously(UI.java:1392)
at com.haulmont.studio.intellij.ui.AbstractVaadinEditor.trySynchronously(SourceFile:129)
at com.haulmont.studio.intellij.ui.AbstractVaadinEditor.selectNotify(SourceFile:78)
at com.haulmont.studio.intellij.ui.AbstractVaadinEditor.selectNotify(SourceFile:55)
at com.intellij.openapi.fileEditor.impl.EditorComposite$1.lambda$selectionChanged$0(EditorComposite.java:139)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:154)
at com.intellij.openapi.fileEditor.impl.EditorComposite$1.selectionChanged(EditorComposite.java:144)
at sun.reflect.GeneratedMethodAccessor109.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:397)
at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:358)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:347)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:331)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:324)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:29)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:196)
at com.sun.proxy.$Proxy150.selectionChanged(Unknown Source)
at com.intellij.openapi.fileEditor.impl.EditorComposite.lambda$fireSelectedEditorChanged$1(EditorComposite.java:212)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$5$1.run(FileEditorManagerImpl.java:1034)
at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:188)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:3049)
at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:172)
at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:124)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:179)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:185)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:63)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$5.run(FileEditorManagerImpl.java:1031)
at com.intellij.openapi.util.BusyObject$Impl$Simple.execute(BusyObject.java:108)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.notifyPublisher(FileEditorManagerImpl.java:1027)
at com.intellij.openapi.fileEditor.impl.EditorComposite.fireSelectedEditorChanged(EditorComposite.java:209)
at com.intellij.openapi.fileEditor.impl.EditorComposite.access$500(EditorComposite.java:60)
at com.intellij.openapi.fileEditor.impl.EditorComposite$MyChangeListener.stateChanged(EditorComposite.java:424)
at com.intellij.ui.JBTabsPaneImpl.fireChanged(JBTabsPaneImpl.java:62)
at com.intellij.ui.JBTabsPaneImpl.access$100(JBTabsPaneImpl.java:22)
at com.intellij.ui.JBTabsPaneImpl$2.selectionChanged(JBTabsPaneImpl.java:48)
at com.intellij.ui.tabs.impl.JBTabsImpl.fireSelectionChanged(JBTabsImpl.java:951)
at com.intellij.ui.tabs.impl.JBTabsImpl.executeSelectionChange(JBTabsImpl.java:907)
at com.intellij.ui.tabs.impl.JBTabsImpl._setSelected(JBTabsImpl.java:871)
at com.intellij.ui.tabs.impl.JBTabsImpl.select(JBTabsImpl.java:853)
at com.intellij.ui.tabs.impl.TabLabel$1.mousePressed(TabLabel.java:96)
at java.awt.Component.processMouseEvent(Component.java:6545)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
at java.awt.Component.processEvent(Component.java:6313)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4903)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4725)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4523)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4725)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:737)
at java.awt.EventQueue$4.run(EventQueue.java:735)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:664)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NullPointerException
at com.haulmont.studio.ui.sd.InheritanceManager.lambda$getSameNameComponents$0(SourceFile:299)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1376)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at com.haulmont.studio.ui.sd.InheritanceManager.getSameNameComponents(SourceFile:300)
at com.haulmont.studio.ui.sd.InheritanceManager.findComponent(SourceFile:244)
at com.haulmont.studio.ui.sd.InheritanceManager.processValueInheritance(SourceFile:453)
at com.haulmont.studio.ui.sd.InheritanceManager.processValueInheritance(SourceFile:458)
at com.haulmont.studio.ui.sd.InheritanceManager.processValueInheritance(SourceFile:458)
at com.haulmont.studio.ui.sd.InheritanceManager.processComponent(SourceFile:378)
at com.haulmont.studio.ui.sd.InheritanceManager.processChildren(SourceFile:142)
at com.haulmont.studio.ui.sd.InheritanceManager.processComponent(SourceFile:416)
at com.haulmont.studio.ui.sd.InheritanceManager.processChildren(SourceFile:142)
at com.haulmont.studio.ui.sd.InheritanceManager.processComponent(SourceFile:416)
at com.haulmont.studio.ui.sd.InheritanceManager.processChildren(SourceFile:142)
at com.haulmont.studio.ui.sd.InheritanceManager.processComponent(SourceFile:416)
at com.haulmont.studio.ui.sd.InheritanceManager.processChildren(SourceFile:142)
at com.haulmont.studio.ui.sd.InheritanceManager.processComponent(SourceFile:416)
at com.haulmont.studio.ui.sd.InheritanceManager.processChildren(SourceFile:142)
at com.haulmont.studio.ui.sd.InheritanceManager.processComponent(SourceFile:416)
at com.haulmont.studio.ui.sd.InheritanceManager.processInheritance(SourceFile:126)
at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.editModel(SourceFile:194)
at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.lambda$activate$7(SourceFile:395)
… 92 more